home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / avwyyt1a / dos32.bas < prev    next >
BASIC Source File  |  1999-09-11  |  106KB  |  2,410 lines

  1. Attribute VB_Name = "dos32"
  2. ' DoS32.bas by ╨║º (xdosx@hotmail.com)
  3.  
  4. Option Explicit
  5.  
  6. Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
  7. Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (destination As Any, Source As Any, ByVal Length As Long)
  8. Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  9. Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
  10. Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  11. Public Declare Function GetMenu Lib "user32" (ByVal hWnd As Long) As Long
  12. Public Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
  13. Public Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
  14. Public Declare Function GetMenuString Lib "user32" Alias "GetMenuStringA" (ByVal hMenu As Long, ByVal wIDItem As Long, ByVal lpString As String, ByVal nMaxCount As Long, ByVal wFlag As Long) As Long
  15. Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
  16. Public Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
  17. Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
  18. Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
  19. Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long
  20. Public Declare Function IsWindowVisible Lib "user32" (ByVal hWnd As Long) As Long
  21. Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
  22. Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
  23. Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  24. Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByVal lpBuffer As String, ByVal nSize As Long, ByRef lpNumberOfBytesWritten As Long) As Long
  25. Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
  26. Public Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
  27. Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
  28. Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
  29. Public Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  30. Public Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
  31. Public Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
  32. Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
  33. Public Declare Function ReleaseCapture Lib "user32" () As Long
  34. Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
  35.  
  36. Public Const BM_GETCHECK = &HF0
  37. Public Const BM_SETCHECK = &HF1
  38.  
  39. Public Const HWND_NOTOPMOST = -2
  40. Public Const HWND_TOPMOST = -1
  41.  
  42. Public Const LB_GETCOUNT = &H18B
  43. Public Const LB_GETITEMDATA = &H199
  44. Public Const LB_GETTEXT = &H189
  45. Public Const LB_GETTEXTLEN = &H18A
  46. Public Const LB_SETCURSEL = &H186
  47. Public Const LB_SETSEL = &H185
  48.  
  49. Public Const SND_ASYNC = &H1
  50. Public Const SND_NODEFAULT = &H2
  51. Public Const SND_FLAG = SND_ASYNC Or SND_NODEFAULT
  52.  
  53. Public Const SW_HIDE = 0
  54. Public Const SW_SHOW = 5
  55.  
  56. Public Const SWP_NOMOVE = &H2
  57. Public Const SWP_NOSIZE = &H1
  58.  
  59. Public Const VK_DOWN = &H28
  60. Public Const VK_LEFT = &H25
  61. Public Const VK_MENU = &H12
  62. Public Const VK_RETURN = &HD
  63. Public Const VK_RIGHT = &H27
  64. Public Const VK_SHIFT = &H10
  65. Public Const VK_SPACE = &H20
  66. Public Const VK_UP = &H26
  67.  
  68. Public Const WM_CHAR = &H102
  69. Public Const WM_CLOSE = &H10
  70. Public Const WM_COMMAND = &H111
  71. Public Const WM_GETTEXT = &HD
  72. Public Const WM_GETTEXTLENGTH = &HE
  73. Public Const WM_KEYDOWN = &H100
  74. Public Const WM_KEYUP = &H101
  75. Public Const WM_LBUTTONDBLCLK = &H203
  76. Public Const WM_LBUTTONDOWN = &H201
  77. Public Const WM_LBUTTONUP = &H202
  78. Public Const WM_MOVE = &HF012
  79. Public Const WM_SETTEXT = &HC
  80. Public Const WM_SYSCOMMAND = &H112
  81.  
  82. Public Const PROCESS_READ = &H10
  83. Public Const RIGHTS_REQUIRED = &HF0000
  84.  
  85. Public Const ENTER_KEY = 13
  86. Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  87.  
  88. Public Type POINTAPI
  89.         X As Long
  90.         Y As Long
  91. End Type
  92.  
  93. Public Function FindForwardWindow() As Long
  94.     Dim AOL As Long, MDI As Long, child As Long
  95.     Dim Rich1 As Long, Rich2 As Long, Combo As Long
  96.     Dim FontCombo As Long
  97.     AOL& = FindWindow("AOL Frame25", vbNullString)
  98.     MDI& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString)
  99.     child& = FindWindowEx(MDI&, 0&, "AOL Child", vbNullString)
  100.     Rich1& = FindWindowEx(child&, 0&, "RICHCNTL", vbNullString)
  101.     Rich2& = FindWindowEx(child&, Rich1&, "RICHCNTL", vbNullString)
  102.     Combo& = FindWindowEx(child&, 0&, "_AOL_Combobox", vbNullString)
  103.     FontCombo& = FindWindowEx(child&, 0&, "_AOL_FontCombo", vbNullString)
  104.     If Rich1& <> 0& And Rich2& = 0& And Combo& = 0& And FontCombo& = 0& Then
  105.         FindForwardWindow& = child&
  106.         Exit Function
  107.     Else
  108.         Do
  109.             child& = FindWindowEx(MDI&, child&, "AOL Child", vbNullString)
  110.             Rich1& = FindWindowEx(child&, 0&, "RICHCNTL", vbNullString)
  111.             Rich2& = FindWindowEx(child&, Rich1&, "RICHCNTL", vbNullString)
  112.             Combo& = FindWindowEx(child&, 0&, "_AOL_Combobox", vbNullString)
  113.             FontCombo& = FindWindowEx(child&, 0&, "_AOL_FontCombo", vbNullString)
  114.             If Rich1& <> 0& And Rich2& = 0& And Combo& = 0& And FontCombo& = 0& Then
  115.                 FindForwardWindow& = child&
  116.                 Exit Function
  117.             End If
  118.         Loop Until child& = 0&
  119.     End If
  120.     FindForwardWindow& = 0&
  121. End Function
  122.  
  123. Public Function FindSendWindow() As Long
  124.     Dim AOL As Long, MDI As Long, child As Long
  125.     Dim SendStatic As Long
  126.     AOL& = FindWindow("AOL Frame25", vbNullString)
  127.     MDI& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString)
  128.     child& = FindWindowEx(MDI&, 0&, "AOL Child", vbNullString)
  129.     SendStatic& = FindWindowEx(child&, 0&, "_AOL_Static", "Send Now")
  130.     If SendStatic& <> 0& Then
  131.         FindSendWindow& = child&
  132.         Exit Function
  133.     Else
  134.         Do
  135.             child& = FindWindowEx(MDI&, child&, "AOL Child", vbNullString)
  136.             SendStatic& = FindWindowEx(child&, 0&, "_AOL_Static", "Send Now")
  137.             If SendStatic& <> 0& Then
  138.                 FindSendWindow& = child&
  139.                 Exit Function
  140.             End If
  141.         Loop Until child& = 0&
  142.     End If
  143.     FindSendWindow& = 0&
  144. End Function
  145.  
  146. Public Sub MailOpenFlash()
  147.     Dim AOL As Long, tool As Long, Toolbar As Long
  148.     Dim ToolIcon As Long, DoThis As Long, sMod As Long
  149.     Dim CurPos As POINTAPI, WinVis As Long
  150.     AOL& = FindWindow("AOL Frame25", vbNullString)
  151.     tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
  152.     Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
  153.     ToolIcon& = FindWindowEx(Toolbar&, 0&, "_AOL_Icon", vbNullString)
  154.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  155.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  156.     Call GetCursorPos(CurPos)
  157.     Call SetCursorPos(Screen.width, Screen.height)
  158.     Call PostMessage(ToolIcon&, WM_LBUTTONDOWN, 0&, 0&)
  159.     Call PostMessage(ToolIcon&, WM_LBUTTONUP, 0&, 0&)
  160.     Do
  161.         sMod& = FindWindow("#32768", vbNullString)
  162.         WinVis& = IsWindowVisible(sMod&)
  163.     Loop Until WinVis& = 1
  164.     Call PostMessage(sMod&, WM_KEYDOWN, VK_UP, 0&)
  165.     Call PostMessage(sMod&, WM_KEYUP, VK_UP, 0&)
  166.     Call PostMessage(sMod&, WM_KEYDOWN, VK_RIGHT, 0&)
  167.     Call PostMessage(sMod&, WM_KEYUP, VK_RIGHT, 0&)
  168.     Call PostMessage(sMod&, WM_KEYDOWN, VK_RETURN, 0&)
  169.     Call PostMessage(sMod&, WM_KEYUP, VK_RETURN, 0&)
  170.     Call SetCursorPos(CurPos.X, CurPos.Y)
  171. End Sub
  172.  
  173. Public Sub MailOpenNew()
  174.     Dim AOL As Long, tool As Long, Toolbar As Long
  175.     Dim ToolIcon As Long, sMod As Long, CurPos As POINTAPI
  176.     Dim WinVis As Long
  177.     AOL& = FindWindow("AOL Frame25", vbNullString)
  178.     tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
  179.     Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
  180.     ToolIcon& = FindWindowEx(Toolbar&, 0&, "_AOL_Icon", vbNullString)
  181.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  182.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  183.     Call GetCursorPos(CurPos)
  184.     Call SetCursorPos(Screen.width, Screen.height)
  185.     Call PostMessage(ToolIcon&, WM_LBUTTONDOWN, 0&, 0&)
  186.     Call PostMessage(ToolIcon&, WM_LBUTTONUP, 0&, 0&)
  187.     Do
  188.         sMod& = FindWindow("#32768", vbNullString)
  189.         WinVis& = IsWindowVisible(sMod&)
  190.     Loop Until WinVis& = 1
  191.     Call PostMessage(sMod&, WM_KEYDOWN, VK_DOWN, 0&)
  192.     Call PostMessage(sMod&, WM_KEYUP, VK_DOWN, 0&)
  193.     Call PostMessage(sMod&, WM_KEYDOWN, VK_DOWN, 0&)
  194.     Call PostMessage(sMod&, WM_KEYUP, VK_DOWN, 0&)
  195.     Call PostMessage(sMod&, WM_KEYDOWN, VK_RETURN, 0&)
  196.     Call PostMessage(sMod&, WM_KEYUP, VK_RETURN, 0&)
  197.     Call SetCursorPos(CurPos.X, CurPos.Y)
  198. End Sub
  199.  
  200. Public Sub MailOpenOld()
  201.     Dim AOL As Long, tool As Long, Toolbar As Long
  202.     Dim ToolIcon As Long, DoThis As Long, sMod As Long
  203.     Dim CurPos As POINTAPI, WinVis As Long
  204.     AOL& = FindWindow("AOL Frame25", vbNullString)
  205.     tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
  206.     Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
  207.     ToolIcon& = FindWindowEx(Toolbar&, 0&, "_AOL_Icon", vbNullString)
  208.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  209.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  210.     Call GetCursorPos(CurPos)
  211.     Call SetCursorPos(Screen.width, Screen.height)
  212.     Call PostMessage(ToolIcon&, WM_LBUTTONDOWN, 0&, 0&)
  213.     Call PostMessage(ToolIcon&, WM_LBUTTONUP, 0&, 0&)
  214.     Do
  215.         sMod& = FindWindow("#32768", vbNullString)
  216.         WinVis& = IsWindowVisible(sMod&)
  217.     Loop Until WinVis& = 1
  218.     For DoThis& = 1 To 4
  219.         Call PostMessage(sMod&, WM_KEYDOWN, VK_DOWN, 0&)
  220.         Call PostMessage(sMod&, WM_KEYUP, VK_DOWN, 0&)
  221.     Next DoThis&
  222.     Call PostMessage(sMod&, WM_KEYDOWN, VK_RETURN, 0&)
  223.     Call PostMessage(sMod&, WM_KEYUP, VK_RETURN, 0&)
  224.     Call SetCursorPos(CurPos.X, CurPos.Y)
  225. End Sub
  226.  
  227. Public Sub MailOpenSent()
  228.     Dim AOL As Long, tool As Long, Toolbar As Long
  229.     Dim ToolIcon As Long, DoThis As Long, sMod As Long
  230.     Dim CurPos As POINTAPI, WinVis As Long
  231.     AOL& = FindWindow("AOL Frame25", vbNullString)
  232.     tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
  233.     Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
  234.     ToolIcon& = FindWindowEx(Toolbar&, 0&, "_AOL_Icon", vbNullString)
  235.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  236.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  237.     Call GetCursorPos(CurPos)
  238.     Call SetCursorPos(Screen.width, Screen.height)
  239.     Call PostMessage(ToolIcon&, WM_LBUTTONDOWN, 0&, 0&)
  240.     Call PostMessage(ToolIcon&, WM_LBUTTONUP, 0&, 0&)
  241.     Do
  242.         sMod& = FindWindow("#32768", vbNullString)
  243.         WinVis& = IsWindowVisible(sMod&)
  244.     Loop Until WinVis& = 1
  245.     For DoThis& = 1 To 5
  246.         Call PostMessage(sMod&, WM_KEYDOWN, VK_DOWN, 0&)
  247.         Call PostMessage(sMod&, WM_KEYUP, VK_DOWN, 0&)
  248.     Next DoThis&
  249.     Call PostMessage(sMod&, WM_KEYDOWN, VK_RETURN, 0&)
  250.     Call PostMessage(sMod&, WM_KEYUP, VK_RETURN, 0&)
  251.     Call SetCursorPos(CurPos.X, CurPos.Y)
  252. End Sub
  253.  
  254. Public Sub MailOpenEmailFlash(index As Long)
  255.     Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
  256.     Dim fCount As Long
  257.     AOL& = FindWindow("AOL Frame25", vbNullString)
  258.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  259.     fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
  260.     fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
  261.     fCount& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
  262.     If fCount& < index& Then Exit Sub
  263.     Call SendMessage(fList&, LB_SETCURSEL, index&, 0&)
  264.     Call PostMessage(fList&, WM_KEYDOWN, VK_RETURN, 0&)
  265.     Call PostMessage(fList&, WM_KEYUP, VK_RETURN, 0&)
  266. End Sub
  267.  
  268. Public Sub MailOpenEmailNew(index As Long)
  269.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  270.     Dim mTree As Long, Count As Long
  271.     MailBox& = FindMailBox&
  272.     If MailBox& = 0& Then Exit Sub
  273.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  274.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  275.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  276.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  277.     If Count& < index& Then Exit Sub
  278.     Call SendMessage(mTree&, LB_SETCURSEL, index&, 0&)
  279.     Call PostMessage(mTree&, WM_KEYDOWN, VK_RETURN, 0&)
  280.     Call PostMessage(mTree&, WM_KEYUP, VK_RETURN, 0&)
  281. End Sub
  282.  
  283. Public Sub MailOpenEmailOld(index As Long)
  284.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  285.     Dim mTree As Long, Count As Long
  286.     MailBox& = FindMailBox&
  287.     If MailBox& = 0& Then Exit Sub
  288.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  289.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  290.     TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
  291.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  292.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  293.     If Count& < index& Then Exit Sub
  294.     Call SendMessage(mTree&, LB_SETCURSEL, index&, 0&)
  295.     Call PostMessage(mTree&, WM_KEYDOWN, VK_RETURN, 0&)
  296.     Call PostMessage(mTree&, WM_KEYUP, VK_RETURN, 0&)
  297. End Sub
  298.  
  299. Public Sub MailOpenEmailSent(index As Long)
  300.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  301.     Dim mTree As Long, Count As Long
  302.     MailBox& = FindMailBox&
  303.     If MailBox& = 0& Then Exit Sub
  304.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  305.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  306.     TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
  307.     TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
  308.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  309.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  310.     If Count& < index& Then Exit Sub
  311.     Call SendMessage(mTree&, LB_SETCURSEL, index&, 0&)
  312.     Call PostMessage(mTree&, WM_KEYDOWN, VK_RETURN, 0&)
  313.     Call PostMessage(mTree&, WM_KEYUP, VK_RETURN, 0&)
  314. End Sub
  315.  
  316. Public Function MailCountFlash() As Long
  317.     Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
  318.     Dim Count As Long
  319.     AOL& = FindWindow("AOL Frame25", vbNullString)
  320.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  321.     fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
  322.     fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
  323.     Count& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
  324.     MailCountFlash& = Count&
  325. End Function
  326.  
  327. Public Sub MailToListFlash(TheList As ListBox)
  328.     Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
  329.     Dim Count As Long, MyString As String, AddMails As Long
  330.     Dim sLength As Long, Spot As Long
  331.     AOL& = FindWindow("AOL Frame25", vbNullString)
  332.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  333.     fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
  334.     If fMail& = 0& Then Exit Sub
  335.     fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
  336.     Count& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
  337.     MyString$ = String(255, 0)
  338.     For AddMails& = 0 To Count& - 1
  339.         DoEvents
  340.         sLength& = SendMessage(fList&, LB_GETTEXTLEN, AddMails&, 0&)
  341.         MyString$ = String(sLength& + 1, 0)
  342.         Call SendMessageByString(fList&, LB_GETTEXT, AddMails&, MyString$)
  343.         Spot& = InStr(MyString$, Chr(9))
  344.         Spot& = InStr(Spot& + 1, MyString$, Chr(9))
  345.         MyString$ = Right(MyString$, Len(MyString$) - Spot&)
  346.         MyString$ = ReplaceString(MyString$, Chr(0), "")
  347.         TheList.AddItem MyString$
  348.     Next AddMails&
  349. End Sub
  350.  
  351. Public Function FindMailBox() As Long
  352.     Dim AOL As Long, MDI As Long, child As Long
  353.     Dim TabControl As Long, TabPage As Long
  354.     AOL& = FindWindow("AOL Frame25", vbNullString)
  355.     MDI& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString)
  356.     child& = FindWindowEx(MDI&, 0&, "AOL Child", vbNullString)
  357.     TabControl& = FindWindowEx(child&, 0&, "_AOL_TabControl", vbNullString)
  358.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  359.     If TabControl& <> 0& And TabPage& <> 0& Then
  360.         FindMailBox& = child&
  361.         Exit Function
  362.     Else
  363.         Do
  364.             child& = FindWindowEx(MDI&, child&, "AOL Child", vbNullString)
  365.             TabControl& = FindWindowEx(child&, 0&, "_AOL_TabControl", vbNullString)
  366.             TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  367.             If TabControl& <> 0& And TabPage& <> 0& Then
  368.                 FindMailBox& = child&
  369.                 Exit Function
  370.             End If
  371.         Loop Until child& = 0&
  372.     End If
  373.     FindMailBox& = 0&
  374. End Function
  375.  
  376. Public Function MailCountNew() As Long
  377.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  378.     Dim mTree As Long, Count As Long
  379.     MailBox& = FindMailBox&
  380.     If MailBox& = 0& Then Exit Function
  381.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  382.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  383.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  384.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  385.     MailCountNew& = Count&
  386. End Function
  387.  
  388. Public Function MailCountSent() As Long
  389.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  390.     Dim mTree As Long, Count As Long
  391.     MailBox& = FindMailBox&
  392.     If MailBox& = 0& Then Exit Function
  393.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  394.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  395.     TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
  396.     TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
  397.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  398.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  399.     MailCountSent& = Count&
  400. End Function
  401.  
  402. Public Function MailCountOld() As Long
  403.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  404.     Dim mTree As Long, Count As Long
  405.     MailBox& = FindMailBox&
  406.     If MailBox& = 0& Then Exit Function
  407.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  408.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  409.     TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
  410.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  411.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  412.     MailCountOld& = Count&
  413. End Function
  414.  
  415. Public Sub MailDeleteNewByIndex(index As Long)
  416.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  417.     Dim mTree As Long, Count As Long, dButton As Long
  418.     MailBox& = FindMailBox&
  419.     If MailBox& = 0& Then Exit Sub
  420.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  421.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  422.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  423.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  424.     If index& > Count& - 1 Or index& < 0& Then Exit Sub
  425.     Call SendMessage(mTree&, LB_SETCURSEL, index&, 0&)
  426.     dButton& = FindWindowEx(MailBox&, 0&, "_AOL_Icon", vbNullString)
  427.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  428.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  429.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  430.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  431.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  432.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  433.     Call SendMessage(dButton&, WM_LBUTTONDOWN, 0&, 0&)
  434.     Call SendMessage(dButton&, WM_LBUTTONUP, 0&, 0&)
  435. End Sub
  436.  
  437. Public Sub MailDeleteNewDuplicates(VBForm As Form, DisplayStatus As Boolean)
  438.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  439.     Dim mTree As Long, Count As Long, dButton As Long
  440.     Dim SearchBox As Long, cSender As String, cSubject As String
  441.     Dim SearchFor As Long, sSender As String, sSubject As String
  442.     Dim CurCaption As String
  443.     MailBox& = FindMailBox&
  444.     CurCaption$ = VBForm.Caption
  445.     If MailBox& = 0& Then Exit Sub
  446.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  447.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  448.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  449.     dButton& = FindWindowEx(MailBox&, 0&, "_AOL_Icon", vbNullString)
  450.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  451.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  452.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  453.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  454.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  455.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  456.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  457.     If Count& = 0& Then Exit Sub
  458.     For SearchFor& = 0& To Count& - 2
  459.         DoEvents
  460.         sSender$ = MailSenderNew(SearchFor&)
  461.         sSubject$ = MailSubjectNew(SearchFor&)
  462.         If sSender$ = "" Then
  463.             VBForm.Caption = CurCaption$
  464.             Exit Sub
  465.         End If
  466.         For SearchBox& = SearchFor& + 1 To Count& - 1
  467.             If DisplayStatus = True Then
  468.                 VBForm.Caption = "Now checking #" & SearchFor& & " for match with #" & SearchBox&
  469.             End If
  470.             cSender$ = MailSenderNew(SearchBox&)
  471.             cSubject$ = MailSubjectNew(SearchBox&)
  472.             If cSender$ = sSender$ And cSubject$ = sSubject$ Then
  473.                 Call SendMessage(mTree&, LB_SETCURSEL, SearchBox&, 0&)
  474.                 DoEvents
  475.                 Call SendMessage(dButton&, WM_LBUTTONDOWN, 0&, 0&)
  476.                 Call SendMessage(dButton&, WM_LBUTTONUP, 0&, 0&)
  477.                 DoEvents
  478.                 SearchBox& = SearchBox& - 1
  479.             End If
  480.         Next SearchBox&
  481.     Next SearchFor&
  482.     VBForm.Caption = CurCaption$
  483. End Sub
  484.  
  485. Public Sub MailDeleteNewBySender(Sender As String)
  486.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  487.     Dim mTree As Long, Count As Long, dButton As Long
  488.     Dim SearchBox As Long, cSender As String
  489.     MailBox& = FindMailBox&
  490.     If MailBox& = 0& Then Exit Sub
  491.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  492.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  493.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  494.     dButton& = FindWindowEx(MailBox&, 0&, "_AOL_Icon", vbNullString)
  495.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  496.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  497.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  498.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  499.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  500.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  501.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  502.     If Count& = 0& Then Exit Sub
  503.     For SearchBox& = 0& To Count& - 1
  504.         cSender$ = MailSenderNew(SearchBox&)
  505.         If LCase(cSender$) = LCase(Sender$) Then
  506.             Call SendMessage(mTree&, LB_SETCURSEL, SearchBox&, 0&)
  507.             DoEvents
  508.             Call SendMessage(dButton&, WM_LBUTTONDOWN, 0&, 0&)
  509.             Call SendMessage(dButton&, WM_LBUTTONUP, 0&, 0&)
  510.             DoEvents
  511.             SearchBox& = SearchBox& - 1
  512.         End If
  513.     Next SearchBox&
  514. End Sub
  515.  
  516. Public Sub MailDeleteNewNotSender(Sender As String)
  517.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  518.     Dim mTree As Long, Count As Long, dButton As Long
  519.     Dim SearchBox As Long, cSender As String
  520.     MailBox& = FindMailBox&
  521.     If MailBox& = 0& Then Exit Sub
  522.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  523.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  524.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  525.     dButton& = FindWindowEx(MailBox&, 0&, "_AOL_Icon", vbNullString)
  526.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  527.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  528.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  529.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  530.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  531.     dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
  532.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  533.     If Count& = 0& Then Exit Sub
  534.     For SearchBox& = 0& To Count& - 1
  535.         cSender$ = MailSenderNew(SearchBox&)
  536.         If cSender$ = "" Then Exit Sub
  537.         If LCase(cSender$) <> LCase(Sender$) Then
  538.             Call SendMessage(mTree&, LB_SETCURSEL, SearchBox&, 0&)
  539.             DoEvents
  540.             Call SendMessage(dButton&, WM_LBUTTONDOWN, 0&, 0&)
  541.             Call SendMessage(dButton&, WM_LBUTTONUP, 0&, 0&)
  542.             DoEvents
  543.             SearchBox& = SearchBox& - 1
  544.         End If
  545.     Next SearchBox&
  546. End Sub
  547.  
  548. Public Function MailSenderFlash(index As Long) As String
  549.     Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
  550.     Dim fCount As Long, DeleteButton As Long, sLength As Long
  551.     Dim MyString As String, Spot1 As Long, Spot2 As Long
  552.     AOL& = FindWindow("AOL Frame25", vbNullString)
  553.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  554.     fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
  555.     fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
  556.     fCount& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
  557.     If fCount& < index& Then Exit Function
  558.     DeleteButton& = FindWindowEx(fMail&, 0&, "_AOL_Icon", vbNullString)
  559.     DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
  560.     DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
  561.     DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
  562.     If fCount& = 0 Or index& > fCount& - 1 Or index& < 0& Then Exit Function
  563.     sLength& = SendMessage(fList&, LB_GETTEXTLEN, index&, 0&)
  564.     MyString$ = String(sLength& + 1, 0)
  565.     Call SendMessageByString(fList&, LB_GETTEXT, index&, MyString$)
  566.     Spot1& = InStr(MyString$, Chr(9))
  567.     Spot2& = InStr(Spot1& + 1, MyString$, Chr(9))
  568.     MyString$ = Mid(MyString$, Spot1& + 1, Spot2& - Spot1& - 1)
  569.     MailSenderFlash$ = MyString$
  570. End Function
  571.  
  572. Public Function MailSenderNew(index As Long) As String
  573.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  574.     Dim mTree As Long, AddMails As Long, sLength As Long
  575.     Dim Spot1 As Long, Spot2 As Long, MyString As String
  576.     Dim Count As Long
  577.     MailBox& = FindMailBox&
  578.     If MailBox& = 0& Then Exit Function
  579.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  580.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  581.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  582.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  583.     If Count& = 0 Or index& > Count& - 1 Or index& < 0& Then Exit Function
  584.     sLength& = SendMessage(mTree&, LB_GETTEXTLEN, index&, 0&)
  585.     MyString$ = String(sLength& + 1, 0)
  586.     Call SendMessageByString(mTree&, LB_GETTEXT, index&, MyString$)
  587.     Spot1& = InStr(MyString$, Chr(9))
  588.     Spot2& = InStr(Spot1& + 1, MyString$, Chr(9))
  589.     MyString$ = Mid(MyString$, Spot1& + 1, Spot2& - Spot1& - 1)
  590.     MailSenderNew$ = MyString$
  591. End Function
  592.  
  593. Public Function MailSubjectFlash(index As Long) As String
  594.     Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
  595.     Dim fCount As Long, DeleteButton As Long, sLength As Long
  596.     Dim MyString As String, Spot As Long
  597.     AOL& = FindWindow("AOL Frame25", vbNullString)
  598.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  599.     fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
  600.     fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
  601.     fCount& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
  602.     If fCount& < index& Then Exit Function
  603.     DeleteButton& = FindWindowEx(fMail&, 0&, "_AOL_Icon", vbNullString)
  604.     DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
  605.     DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
  606.     DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
  607.     If fCount& = 0 Or index& > fCount& - 1 Or index& < 0& Then Exit Function
  608.     sLength& = SendMessage(fList&, LB_GETTEXTLEN, index&, 0&)
  609.     MyString$ = String(sLength& + 1, 0)
  610.     Call SendMessageByString(fList&, LB_GETTEXT, index&, MyString$)
  611.     Spot& = InStr(MyString$, Chr(9))
  612.     Spot& = InStr(Spot& + 1, MyString$, Chr(9))
  613.     MyString$ = Right(MyString$, Len(MyString$) - Spot&)
  614.     MyString$ = ReplaceString(MyString$, Chr(0), "")
  615.     MailSubjectFlash$ = MyString$
  616. End Function
  617.  
  618. Public Function MailSubjectNew(index As Long) As String
  619.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  620.     Dim mTree As Long, AddMails As Long, sLength As Long
  621.     Dim Spot As Long, MyString As String, Count As Long
  622.     MailBox& = FindMailBox&
  623.     If MailBox& = 0& Then Exit Function
  624.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  625.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  626.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  627.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  628.     If Count& = 0 Or index& > Count& - 1 Or index& < 0& Then Exit Function
  629.     sLength& = SendMessage(mTree&, LB_GETTEXTLEN, index&, 0&)
  630.     MyString$ = String(sLength& + 1, 0)
  631.     Call SendMessageByString(mTree&, LB_GETTEXT, index&, MyString$)
  632.     Spot& = InStr(MyString$, Chr(9))
  633.     Spot& = InStr(Spot& + 1, MyString$, Chr(9))
  634.     MyString$ = Right(MyString$, Len(MyString$) - Spot&)
  635.     MyString$ = ReplaceString(MyString$, Chr(0), "")
  636.     MailSubjectNew$ = MyString$
  637. End Function
  638.  
  639. Public Sub MailToListNew(TheList As ListBox)
  640.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  641.     Dim mTree As Long, AddMails As Long, sLength As Long
  642.     Dim Spot As Long, MyString As String, Count As Long
  643.     MailBox& = FindMailBox&
  644.     If MailBox& = 0& Then Exit Sub
  645.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  646.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  647.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  648.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  649.     If Count& = 0 Then Exit Sub
  650.     For AddMails& = 0 To Count& - 1
  651.         DoEvents
  652.         sLength& = SendMessage(mTree&, LB_GETTEXTLEN, AddMails&, 0&)
  653.         MyString$ = String(sLength& + 1, 0)
  654.         Call SendMessageByString(mTree&, LB_GETTEXT, AddMails&, MyString$)
  655.         Spot& = InStr(MyString$, Chr(9))
  656.         Spot& = InStr(Spot& + 1, MyString$, Chr(9))
  657.         MyString$ = Right(MyString$, Len(MyString$) - Spot&)
  658.         TheList.AddItem MyString$
  659.     Next AddMails&
  660. End Sub
  661.  
  662. Public Sub MailToListOld(TheList As ListBox)
  663.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  664.     Dim mTree As Long, AddMails As Long, sLength As Long
  665.     Dim Spot As Long, MyString As String, Count As Long
  666.     MailBox& = FindMailBox&
  667.     If MailBox& = 0& Then Exit Sub
  668.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  669.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  670.     TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
  671.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  672.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  673.     If Count& = 0 Then Exit Sub
  674.     For AddMails& = 0 To Count& - 1
  675.         DoEvents
  676.         sLength& = SendMessage(mTree&, LB_GETTEXTLEN, AddMails&, 0&)
  677.         MyString$ = String(sLength& + 1, 0)
  678.         Call SendMessageByString(mTree&, LB_GETTEXT, AddMails&, MyString$)
  679.         Spot& = InStr(MyString$, Chr(9))
  680.         Spot& = InStr(Spot& + 1, MyString$, Chr(9))
  681.         MyString$ = Right(MyString$, Len(MyString$) - Spot&)
  682.         TheList.AddItem MyString$
  683.     Next AddMails&
  684. End Sub
  685.  
  686. Public Sub MailToListSent(TheList As ListBox)
  687.     Dim MailBox As Long, TabControl As Long, TabPage As Long
  688.     Dim mTree As Long, AddMails As Long, sLength As Long
  689.     Dim Spot As Long, MyString As String, Count As Long
  690.     MailBox& = FindMailBox&
  691.     If MailBox& = 0& Then Exit Sub
  692.     TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
  693.     TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
  694.     TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
  695.     TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
  696.     mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
  697.     Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
  698.     If Count& = 0 Then Exit Sub
  699.     For AddMails& = 0 To Count& - 1
  700.         DoEvents
  701.         sLength& = SendMessage(mTree&, LB_GETTEXTLEN, AddMails&, 0&)
  702.         MyString$ = String(sLength& + 1, 0)
  703.         Call SendMessageByString(mTree&, LB_GETTEXT, AddMails&, MyString$)
  704.         Spot& = InStr(MyString$, Chr(9))
  705.         Spot& = InStr(Spot& + 1, MyString$, Chr(9))
  706.         MyString$ = Right(MyString$, Len(MyString$) - Spot&)
  707.         TheList.AddItem MyString$
  708.     Next AddMails&
  709. End Sub
  710.  
  711. Public Sub SendMail(Person As String, subject As String, Message As String)
  712.     Dim AOL As Long, MDI As Long, tool As Long, Toolbar As Long
  713.     Dim ToolIcon As Long, OpenSend As Long, DoIt As Long
  714.     Dim Rich As Long, EditTo As Long, EditCC As Long
  715.     Dim EditSubject As Long, SendButton As Long
  716.     Dim Combo As Long, fCombo As Long, ErrorWindow As Long
  717.     Dim Button1 As Long, Button2 As Long
  718.     AOL& = FindWindow("AOL Frame25", vbNullString)
  719.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  720.     tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
  721.     Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
  722.     ToolIcon& = FindWindowEx(Toolbar&, 0&, "_AOL_Icon", vbNullString)
  723.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  724.     Call PostMessage(ToolIcon&, WM_LBUTTONDOWN, 0&, 0&)
  725.     Call PostMessage(ToolIcon&, WM_LBUTTONUP, 0&, 0&)
  726.     DoEvents
  727.     Do
  728.         DoEvents
  729.         OpenSend& = FindWindowEx(MDI&, 0&, "AOL Child", "Write Mail")
  730.         EditTo& = FindWindowEx(OpenSend&, 0&, "_AOL_Edit", vbNullString)
  731.         EditCC& = FindWindowEx(OpenSend&, EditTo&, "_AOL_Edit", vbNullString)
  732.         EditSubject& = FindWindowEx(OpenSend&, EditCC&, "_AOL_Edit", vbNullString)
  733.         Rich& = FindWindowEx(OpenSend&, 0&, "RICHCNTL", vbNullString)
  734.         Combo& = FindWindowEx(OpenSend&, 0&, "_AOL_Combobox", vbNullString)
  735.         fCombo& = FindWindowEx(OpenSend&, 0&, "_AOL_Fontcombo", vbNullString)
  736.         Button1& = FindWindowEx(OpenSend&, 0&, "_AOL_Icon", vbNullString)
  737.         Button2& = FindWindowEx(OpenSend&, Button1&, "_AOL_Icon", vbNullString)
  738.         SendButton& = FindWindowEx(OpenSend&, 0&, "_AOL_Icon", vbNullString)
  739.         For DoIt& = 1 To 13
  740.             SendButton& = FindWindowEx(OpenSend&, SendButton&, "_AOL_Icon", vbNullString)
  741.         Next DoIt&
  742.     Loop Until OpenSend& <> 0& And EditTo& <> 0& And EditCC& <> 0& And EditSubject& <> 0& And Rich& <> 0& And SendButton& <> 0& And Combo& <> 0& And fCombo& <> 0& & SendButton& <> Button1& And SendButton& <> Button2&
  743.     Call SendMessageByString(EditTo&, WM_SETTEXT, 0, Person$)
  744.     DoEvents
  745.     Call SendMessageByString(EditSubject&, WM_SETTEXT, 0, subject$)
  746.     DoEvents
  747.     Call SendMessageByString(Rich&, WM_SETTEXT, 0, Message$)
  748.     DoEvents
  749.     Pause 0.2
  750.     Call SendMessage(SendButton&, WM_LBUTTONDOWN, 0&, 0&)
  751.     Call SendMessage(SendButton&, WM_LBUTTONUP, 0&, 0&)
  752. End Sub
  753.  
  754. Public Sub MailForward(SendTo As String, Message As String, DeleteFwd As Boolean)
  755.     Dim AOL As Long, MDI As Long, error As Long
  756.     Dim OpenForward As Long, OpenSend As Long, SendButton As Long
  757.     Dim DoIt As Long, EditTo As Long, EditCC As Long
  758.     Dim EditSubject As Long, Rich As Long, fCombo As Long
  759.     Dim Combo As Long, Button1 As Long, Button2 As Long
  760.     Dim TempSubject As String
  761.     OpenForward& = FindForwardWindow
  762.     If OpenForward& = 0 Then Exit Sub
  763.     SendButton& = FindWindowEx(OpenForward&, 0&, "_AOL_Icon", vbNullString)
  764.     For DoIt& = 1 To 6
  765.         SendButton& = FindWindowEx(OpenForward&, SendButton&, "_AOL_Icon", vbNullString)
  766.     Next DoIt&
  767.     Call SendMessage(SendButton&, WM_LBUTTONDOWN, 0&, 0&)
  768.     Call SendMessage(SendButton&, WM_LBUTTONUP, 0&, 0&)
  769.     Do
  770.         DoEvents
  771.         OpenSend& = FindSendWindow
  772.         EditTo& = FindWindowEx(OpenSend&, 0&, "_AOL_Edit", vbNullString)
  773.         EditCC& = FindWindowEx(OpenSend&, EditTo&, "_AOL_Edit", vbNullString)
  774.         EditSubject& = FindWindowEx(OpenSend&, EditCC&, "_AOL_Edit", vbNullString)
  775.         Rich& = FindWindowEx(OpenSend&, 0&, "RICHCNTL", vbNullString)
  776.         Combo& = FindWindowEx(OpenSend&, 0&, "_AOL_Combobox", vbNullString)
  777.         fCombo& = FindWindowEx(OpenSend&, 0&, "_AOL_Fontcombo", vbNullString)
  778.         Button1& = FindWindowEx(OpenSend&, 0&, "_AOL_Icon", vbNullString)
  779.         Button2& = FindWindowEx(OpenSend&, Button1&, "_AOL_Icon", vbNullString)
  780.         SendButton& = FindWindowEx(OpenSend&, 0&, "_AOL_Icon", vbNullString)
  781.         For DoIt& = 1 To 13
  782.             SendButton& = FindWindowEx(OpenSend&, SendButton&, "_AOL_Icon", vbNullString)
  783.         Next DoIt&
  784.     Loop Until OpenSend& <> 0& And EditTo& <> 0& And EditCC& <> 0& And EditSubject& <> 0& And Rich& <> 0& And SendButton& <> 0& And Combo& <> 0& And fCombo& <> 0& & SendButton& <> Button1& And SendButton& <> Button2&
  785.     If DeleteFwd = True Then
  786.         TempSubject$ = GetText(EditSubject&)
  787.         TempSubject$ = Right(TempSubject$, Len(TempSubject$) - 5)
  788.         Call SendMessageByString(EditSubject&, WM_SETTEXT, 0, TempSubject$)
  789.         DoEvents
  790.     End If
  791.     Call SendMessageByString(EditTo&, WM_SETTEXT, 0, SendTo$)
  792.     DoEvents
  793.     Call SendMessageByString(Rich&, WM_SETTEXT, 0, Message$)
  794.     DoEvents
  795.     Do Until OpenSend& = 0& Or error& <> 0&
  796.         DoEvents
  797.         AOL& = FindWindow("AOL Frame25", vbNullString)
  798.         MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  799.         error& = FindWindowEx(MDI&, 0&, "AOL Child", "Error")
  800.         OpenSend& = FindSendWindow
  801.         SendButton& = FindWindowEx(OpenSend&, 0&, "_AOL_Icon", vbNullString)
  802.         For DoIt& = 1 To 11
  803.             SendButton& = FindWindowEx(OpenSend&, SendButton&, "_AOL_Icon", vbNullString)
  804.         Next DoIt&
  805.         Call SendMessage(SendButton&, WM_LBUTTONDOWN, 0&, 0&)
  806.         Call SendMessage(SendButton&, WM_LBUTTONUP, 0&, 0&)
  807.         Pause 1
  808.     Loop
  809.     If OpenSend& = 0& Then Call PostMessage(OpenForward&, WM_CLOSE, 0&, 0&)
  810. End Sub
  811.  
  812. Public Sub CloseOpenMails()
  813.     Dim OpenSend As Long, OpenForward As Long
  814.     Do
  815.         DoEvents
  816.         OpenSend& = FindSendWindow
  817.         OpenForward& = FindForwardWindow
  818.         Call PostMessage(OpenSend&, WM_CLOSE, 0&, 0&)
  819.         DoEvents
  820.         Call PostMessage(OpenForward&, WM_CLOSE, 0&, 0&)
  821.         DoEvents
  822.     Loop Until OpenSend& = 0& And OpenForward& = 0&
  823. End Sub
  824.  
  825. Public Sub MailDeleteFlashByIndex(index As Long)
  826.     Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
  827.     Dim fCount As Long, DeleteButton As Long
  828.     AOL& = FindWindow("AOL Frame25", vbNullString)
  829.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  830.     fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
  831.     fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
  832.     fCount& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
  833.     If fCount& < index& Then Exit Sub
  834.     DeleteButton& = FindWindowEx(fMail&, 0&, "_AOL_Icon", vbNullString)
  835.     DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
  836.     DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
  837.     DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
  838.     Call SendMessage(fList&, LB_SETCURSEL, index&, 0&)
  839.     Call SendMessage(DeleteButton&, WM_LBUTTONDOWN, 0&, 0&)
  840.     Call SendMessage(DeleteButton&, WM_LBUTTONUP, 0&, 0&)
  841. End Sub
  842.  
  843. Public Sub MailDeleteFlashDuplicates(VBForm As Form, DisplayStatus As Boolean)
  844.     Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
  845.     Dim fCount As Long, DeleteButton As Long, SearchFor As Long
  846.     Dim SearchBox As Long, CurCaption As String
  847.     Dim sSender As String, sSubject As String
  848.     Dim cSender As String, cSubject As String
  849.     AOL& = FindWindow("AOL Frame25", vbNullString)
  850.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  851.     fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
  852.     fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
  853.     fCount& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
  854.     If fCount& < 2& Then Exit Sub
  855.     DeleteButton& = FindWindowEx(fMail&, 0&, "_AOL_Icon", vbNullString)
  856.     DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
  857.     DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
  858.     DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
  859.     CurCaption$ = VBForm.Caption
  860.     If fCount& = 0& Then Exit Sub
  861.     For SearchFor& = 0& To fCount& - 2
  862.         DoEvents
  863.         sSender$ = MailSenderFlash(SearchFor&)
  864.         sSubject$ = MailSubjectFlash(SearchFor&)
  865.         If sSender$ = "" Then
  866.             VBForm.Caption = CurCaption$
  867.             Exit Sub
  868.         End If
  869.         For SearchBox& = SearchFor& + 1 To fCount& - 1
  870.             If DisplayStatus = True Then
  871.                 VBForm.Caption = "Checking #" & SearchFor& & " with #" & SearchBox&
  872.             End If
  873.             cSender$ = MailSenderFlash(SearchBox&)
  874.             cSubject$ = MailSubjectFlash(SearchBox&)
  875.             If cSender$ = sSender$ And cSubject$ = sSubject$ Then
  876.                 Call SendMessage(fList&, LB_SETCURSEL, SearchBox&, 0&)
  877.                 DoEvents
  878.                 Call SendMessage(DeleteButton&, WM_LBUTTONDOWN, 0&, 0&)
  879.                 Call SendMessage(DeleteButton&, WM_LBUTTONUP, 0&, 0&)
  880.                 DoEvents
  881.                 SearchBox& = SearchBox& - 1
  882.             End If
  883.         Next SearchBox&
  884.     Next SearchFor&
  885.     VBForm.Caption = CurCaption$
  886. End Sub
  887.  
  888. Public Sub SetMailPrefs()
  889.     Dim AOL As Long, tool As Long, Toolbar As Long
  890.     Dim ToolIcon As Long, DoThis As Long, sMod As Long
  891.     Dim MDI As Long, mPrefs As Long, mButton As Long
  892.     Dim gStatic As Long, mStatic As Long, fStatic As Long
  893.     Dim maStatic As Long, dMod As Long, ConfirmCheck As Long
  894.     Dim CloseCheck As Long, SpellCheck As Long, OKButton As Long
  895.     Dim CurPos As POINTAPI, WinVis As Long
  896.     AOL& = FindWindow("AOL Frame25", vbNullString)
  897.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  898.     tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
  899.     Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
  900.     ToolIcon& = FindWindowEx(Toolbar&, 0&, "_AOL_Icon", vbNullString)
  901.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  902.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  903.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  904.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  905.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  906.     Call GetCursorPos(CurPos)
  907.     Call SetCursorPos(Screen.width, Screen.height)
  908.     Call PostMessage(ToolIcon&, WM_LBUTTONDOWN, 0&, 0&)
  909.     Call PostMessage(ToolIcon&, WM_LBUTTONUP, 0&, 0&)
  910.     Do
  911.         sMod& = FindWindow("#32768", vbNullString)
  912.         WinVis& = IsWindowVisible(sMod&)
  913.     Loop Until WinVis& = 1
  914.     For DoThis& = 1 To 3
  915.         Call PostMessage(sMod&, WM_KEYDOWN, VK_DOWN, 0&)
  916.         Call PostMessage(sMod&, WM_KEYUP, VK_DOWN, 0&)
  917.     Next DoThis&
  918.     Call PostMessage(sMod&, WM_KEYDOWN, VK_RETURN, 0&)
  919.     Call PostMessage(sMod&, WM_KEYUP, VK_RETURN, 0&)
  920.     Call SetCursorPos(CurPos.X, CurPos.Y)
  921.     Do
  922.         DoEvents
  923.         mPrefs& = FindWindowEx(MDI&, 0&, "AOL Child", "Preferences")
  924.         gStatic& = FindWindowEx(mPrefs&, 0&, "_AOL_Static", "General")
  925.         mStatic& = FindWindowEx(mPrefs&, 0&, "_AOL_Static", "Mail")
  926.         fStatic& = FindWindowEx(mPrefs&, 0&, "_AOL_Static", "Font")
  927.         maStatic& = FindWindowEx(mPrefs&, 0&, "_AOL_Static", "Marketing")
  928.     Loop Until mPrefs& <> 0& And gStatic& <> 0& And mStatic& <> 0& And fStatic& <> 0& And maStatic& <> 0&
  929.     mButton& = FindWindowEx(mPrefs&, 0&, "_AOL_Icon", vbNullString)
  930.     mButton& = FindWindowEx(mPrefs&, mButton&, "_AOL_Icon", vbNullString)
  931.     mButton& = FindWindowEx(mPrefs&, mButton&, "_AOL_Icon", vbNullString)
  932.     Do
  933.         DoEvents
  934.         Call SendMessage(mButton&, WM_LBUTTONDOWN, 0&, 0&)
  935.         Call SendMessage(mButton&, WM_LBUTTONUP, 0&, 0&)
  936.         dMod& = FindWindow("_AOL_Modal", "Mail Preferences")
  937.         Pause 0.6
  938.     Loop Until dMod& <> 0&
  939.     ConfirmCheck& = FindWindowEx(dMod&, 0&, "_AOL_Checkbox", vbNullString)
  940.     CloseCheck& = FindWindowEx(dMod&, ConfirmCheck&, "_AOL_Checkbox", vbNullString)
  941.     SpellCheck& = FindWindowEx(dMod&, CloseCheck&, "_AOL_Checkbox", vbNullString)
  942.     SpellCheck& = FindWindowEx(dMod&, SpellCheck&, "_AOL_Checkbox", vbNullString)
  943.     SpellCheck& = FindWindowEx(dMod&, SpellCheck&, "_AOL_Checkbox", vbNullString)
  944.     SpellCheck& = FindWindowEx(dMod&, SpellCheck&, "_AOL_Checkbox", vbNullString)
  945.     OKButton& = FindWindowEx(dMod&, 0&, "_AOL_icon", vbNullString)
  946.     Call SendMessage(ConfirmCheck&, BM_SETCHECK, False, vbNullString)
  947.     Call SendMessage(CloseCheck&, BM_SETCHECK, True, vbNullString)
  948.     Call SendMessage(SpellCheck&, BM_SETCHECK, False, vbNullString)
  949.     Call SendMessage(OKButton&, WM_LBUTTONDOWN, 0&, 0&)
  950.     Call SendMessage(OKButton&, WM_LBUTTONUP, 0&, 0&)
  951.     DoEvents
  952.     Call PostMessage(mPrefs&, WM_CLOSE, 0&, 0&)
  953. End Sub
  954.  
  955. Public Function ErrorName(name As Long) As String
  956.     Dim AOL As Long, MDI As Long, ErrorWindow As Long
  957.     Dim ErrorTextWindow As Long, ErrorString As String
  958.     Dim NameCount As Long, TempString As String
  959.     AOL& = FindWindow("AOL Frame25", vbNullString)
  960.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  961.     ErrorWindow& = FindWindowEx(MDI&, 0&, "AOL Child", "Error")
  962.     If ErrorWindow& = 0& Then Exit Function
  963.     ErrorTextWindow& = FindWindowEx(ErrorWindow&, 0&, "_AOL_View", vbNullString)
  964.     ErrorString$ = GetText(ErrorTextWindow&)
  965.     NameCount& = LineCount(ErrorString$) - 2
  966.     If NameCount& < name& Then Exit Function
  967.     TempString$ = LineFromString(ErrorString$, name& + 2)
  968.     TempString$ = Left(TempString$, InStr(TempString$, "-") - 2)
  969.     ErrorName$ = TempString$
  970. End Function
  971.  
  972. Public Function ErrorNameCount() As Long
  973.     Dim AOL As Long, MDI As Long, ErrorWindow As Long
  974.     Dim ErrorTextWindow As Long, ErrorString As String
  975.     Dim NameCount As Long
  976.     AOL& = FindWindow("AOL Frame25", vbNullString)
  977.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  978.     ErrorWindow& = FindWindowEx(MDI&, 0&, "AOL Child", "Error")
  979.     If ErrorWindow& = 0& Then Exit Function
  980.     ErrorTextWindow& = FindWindowEx(ErrorWindow&, 0&, "_AOL_View", vbNullString)
  981.     ErrorString$ = GetText(ErrorTextWindow&)
  982.     NameCount& = LineCount(ErrorString$) - 2
  983.     ErrorNameCount& = NameCount&
  984. End Function
  985.  
  986. Public Function CheckAlive(ScreenName As String) As Boolean
  987.     Dim AOL As Long, MDI As Long, ErrorWindow As Long
  988.     Dim ErrorTextWindow As Long, ErrorString As String
  989.     Dim MailWindow As Long, NoWindow As Long, NoButton As Long
  990.     Call SendMail("*, " & ScreenName$, "You alive?", "=)")
  991.     AOL& = FindWindow("AOL Frame25", vbNullString)
  992.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  993.     Do
  994.         DoEvents
  995.         ErrorWindow& = FindWindowEx(MDI&, 0&, "AOL Child", "Error")
  996.         ErrorTextWindow& = FindWindowEx(ErrorWindow&, 0&, "_AOL_View", vbNullString)
  997.         ErrorString$ = GetText(ErrorTextWindow&)
  998.     Loop Until ErrorWindow& <> 0 And ErrorTextWindow& <> 0 And ErrorString$ <> ""
  999.     If InStr(LCase(ReplaceString(ErrorString$, " ", "")), LCase(ReplaceString(ScreenName$, " ", ""))) > 0 Then
  1000.         CheckAlive = False
  1001.     Else
  1002.         CheckAlive = True
  1003.     End If
  1004.     MailWindow& = FindWindowEx(MDI&, 0&, "AOL Child", "Write Mail")
  1005.     Call PostMessage(ErrorWindow&, WM_CLOSE, 0&, 0&)
  1006.     DoEvents
  1007.     Call PostMessage(MailWindow&, WM_CLOSE, 0&, 0&)
  1008.     DoEvents
  1009.     Do
  1010.         DoEvents
  1011.         NoWindow& = FindWindow("#32770", "America Online")
  1012.         NoButton& = FindWindowEx(NoWindow&, 0&, "Button", "&No")
  1013.     Loop Until NoWindow& <> 0& And NoButton& <> 0
  1014.     Call SendMessage(NoButton&, WM_KEYDOWN, VK_SPACE, 0&)
  1015.     Call SendMessage(NoButton&, WM_KEYUP, VK_SPACE, 0&)
  1016. End Function
  1017.  
  1018. Public Sub ChatSend(Chat As String)
  1019.     Dim Room As Long, AORich As Long, AORich2 As Long
  1020.     Room& = FindRoom&
  1021.     AORich& = FindWindowEx(Room, 0&, "RICHCNTL", vbNullString)
  1022.     AORich2& = FindWindowEx(Room, AORich, "RICHCNTL", vbNullString)
  1023.     Call SendMessageByString(AORich2, WM_SETTEXT, 0&, Chat$)
  1024.     Call SendMessageLong(AORich2, WM_CHAR, ENTER_KEY, 0&)
  1025. End Sub
  1026.  
  1027. Public Function FindIM() As Long
  1028.     Dim AOL As Long, MDI As Long, child As Long, Caption As String
  1029.     AOL& = FindWindow("AOL Frame25", vbNullString)
  1030.     MDI& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString)
  1031.     child& = FindWindowEx(MDI&, 0&, "AOL Child", vbNullString)
  1032.     Caption$ = GetCaption(child&)
  1033.     If InStr(Caption$, "Instant Message") = 1 Or InStr(Caption$, "Instant Message") = 2 Or InStr(Caption$, "Instant Message") = 3 Then
  1034.         FindIM& = child&
  1035.         Exit Function
  1036.     Else
  1037.         Do
  1038.             child& = FindWindowEx(MDI&, child&, "AOL Child", vbNullString)
  1039.             Caption$ = GetCaption(child&)
  1040.             If InStr(Caption$, "Instant Message") = 1 Or InStr(Caption$, "Instant Message") = 2 Or InStr(Caption$, "Instant Message") = 3 Then
  1041.                 FindIM& = child&
  1042.                 Exit Function
  1043.             End If
  1044.         Loop Until child& = 0&
  1045.     End If
  1046.     FindIM& = child&
  1047. End Function
  1048.  
  1049. Public Function FindRoom() As Long
  1050.     Dim AOL As Long, MDI As Long, child As Long
  1051.     Dim Rich As Long, AOLList As Long
  1052.     Dim AOLIcon As Long, AOLStatic As Long
  1053.     AOL& = FindWindow("AOL Frame25", vbNullString)
  1054.     MDI& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString)
  1055.     child& = FindWindowEx(MDI&, 0&, "AOL Child", vbNullString)
  1056.     Rich& = FindWindowEx(child&, 0&, "RICHCNTL", vbNullString)
  1057.     AOLList& = FindWindowEx(child&, 0&, "_AOL_Listbox", vbNullString)
  1058.     AOLIcon& = FindWindowEx(child&, 0&, "_AOL_Icon", vbNullString)
  1059.     AOLStatic& = FindWindowEx(child&, 0&, "_AOL_Static", vbNullString)
  1060.     If Rich& <> 0& And AOLList& <> 0& And AOLIcon& <> 0& And AOLStatic& <> 0& Then
  1061.         FindRoom& = child&
  1062.         Exit Function
  1063.     Else
  1064.         Do
  1065.             child& = FindWindowEx(MDI&, child&, "AOL Child", vbNullString)
  1066.             Rich& = FindWindowEx(child&, 0&, "RICHCNTL", vbNullString)
  1067.             AOLList& = FindWindowEx(child&, 0&, "_AOL_Listbox", vbNullString)
  1068.             AOLIcon& = FindWindowEx(child&, 0&, "_AOL_Icon", vbNullString)
  1069.             AOLStatic& = FindWindowEx(child&, 0&, "_AOL_Static", vbNullString)
  1070.             If Rich& <> 0& And AOLList& <> 0& And AOLIcon& <> 0& And AOLStatic& <> 0& Then
  1071.                 FindRoom& = child&
  1072.                 Exit Function
  1073.             End If
  1074.         Loop Until child& = 0&
  1075.     End If
  1076.     FindRoom& = child&
  1077. End Function
  1078.  
  1079. Public Function FindInfoWindow() As Long
  1080.     Dim AOL As Long, MDI As Long, child As Long
  1081.     Dim AOLCheck As Long, AOLIcon As Long, AOLStatic As Long
  1082.     Dim AOLIcon2 As Long, AOLGlyph As Long
  1083.     AOL& = FindWindow("AOL Frame25", vbNullString)
  1084.     MDI& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString)
  1085.     child& = FindWindowEx(MDI&, 0&, "AOL Child", vbNullString)
  1086.     AOLCheck& = FindWindowEx(child&, 0&, "_AOL_Checkbox", vbNullString)
  1087.     AOLStatic& = FindWindowEx(child&, 0&, "_AOL_Static", vbNullString)
  1088.     AOLGlyph& = FindWindowEx(child&, 0&, "_AOL_Glyph", vbNullString)
  1089.     AOLIcon& = FindWindowEx(child&, 0&, "_AOL_Icon", vbNullString)
  1090.     AOLIcon2& = FindWindowEx(child&, AOLIcon&, "_AOL_Icon", vbNullString)
  1091.     If AOLCheck& <> 0& And AOLStatic& <> 0& And AOLGlyph& <> 0& And AOLIcon& <> 0& And AOLIcon2& <> 0& Then
  1092.         FindInfoWindow& = child&
  1093.         Exit Function
  1094.     Else
  1095.         Do
  1096.             child& = FindWindowEx(MDI&, child&, "AOL Child", vbNullString)
  1097.             AOLCheck& = FindWindowEx(child&, 0&, "_AOL_Checkbox", vbNullString)
  1098.             AOLStatic& = FindWindowEx(child&, 0&, "_AOL_Static", vbNullString)
  1099.             AOLGlyph& = FindWindowEx(child&, 0&, "_AOL_Glyph", vbNullString)
  1100.             AOLIcon& = FindWindowEx(child&, 0&, "_AOL_Icon", vbNullString)
  1101.             AOLIcon2& = FindWindowEx(child&, AOLIcon&, "_AOL_Icon", vbNullString)
  1102.             If AOLCheck& <> 0& And AOLStatic& <> 0& And AOLGlyph& <> 0& And AOLIcon& <> 0& And AOLIcon2& <> 0& Then
  1103.                 FindInfoWindow& = child&
  1104.                 Exit Function
  1105.             End If
  1106.         Loop Until child& = 0&
  1107.     End If
  1108.     FindInfoWindow& = child&
  1109. End Function
  1110.  
  1111. Public Function RoomCount() As Long
  1112.     Dim AOL As Long, MDI As Long, rMail As Long, rList As Long
  1113.     Dim Count As Long
  1114.     AOL& = FindWindow("AOL Frame25", vbNullString)
  1115.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  1116.     rMail& = FindRoom
  1117.     rList& = FindWindowEx(rMail&, 0&, "_AOL_Listbox", vbNullString)
  1118.     Count& = SendMessage(rList&, LB_GETCOUNT, 0&, 0&)
  1119.     RoomCount& = Count&
  1120. End Function
  1121.  
  1122. Public Sub AddRoomToListbox(TheList As ListBox, AddUser As Boolean)
  1123.     On Error Resume Next
  1124.     Dim cProcess As Long, itmHold As Long, ScreenName As String
  1125.     Dim psnHold As Long, rBytes As Long, index As Long, Room As Long
  1126.     Dim rList As Long, sThread As Long, mThread As Long
  1127.     Room& = FindRoom&
  1128.     If Room& = 0& Then Exit Sub
  1129.     rList& = FindWindowEx(Room&, 0&, "_AOL_Listbox", vbNullString)
  1130.     sThread& = GetWindowThreadProcessId(rList, cProcess&)
  1131.     mThread& = OpenProcess(PROCESS_READ Or RIGHTS_REQUIRED, False, cProcess&)
  1132.     If mThread& Then
  1133.         For index& = 0 To SendMessage(rList, LB_GETCOUNT, 0, 0) - 1
  1134.             ScreenName$ = String$(4, vbNullChar)
  1135.             itmHold& = SendMessage(rList, LB_GETITEMDATA, ByVal CLng(index&), ByVal 0&)
  1136.             itmHold& = itmHold& + 24
  1137.             Call ReadProcessMemory(mThread&, itmHold&, ScreenName$, 4, rBytes)
  1138.             Call CopyMemory(psnHold&, ByVal ScreenName$, 4)
  1139.             psnHold& = psnHold& + 6
  1140.             ScreenName$ = String$(16, vbNullChar)
  1141.             Call ReadProcessMemory(mThread&, psnHold&, ScreenName$, Len(ScreenName$), rBytes&)
  1142.             ScreenName$ = Left$(ScreenName$, InStr(ScreenName$, vbNullChar) - 1)
  1143.             If ScreenName$ <> GetUser$ Or AddUser = True Then
  1144.                 TheList.AddItem ScreenName$
  1145.             End If
  1146.         Next index&
  1147.         Call CloseHandle(mThread)
  1148.     End If
  1149. End Sub
  1150.  
  1151. Public Sub AddRoomToCombobox(TheCombo As ComboBox, AddUser As Boolean)
  1152.     On Error Resume Next
  1153.     Dim cProcess As Long, itmHold As Long, ScreenName As String
  1154.     Dim psnHold As Long, rBytes As Long, index As Long, Room As Long
  1155.     Dim rList As Long, sThread As Long, mThread As Long
  1156.     Room& = FindRoom&
  1157.     If Room& = 0& Then Exit Sub
  1158.     rList& = FindWindowEx(Room&, 0&, "_AOL_Listbox", vbNullString)
  1159.     sThread& = GetWindowThreadProcessId(rList, cProcess&)
  1160.     mThread& = OpenProcess(PROCESS_READ Or RIGHTS_REQUIRED, False, cProcess&)
  1161.     If mThread& Then
  1162.         For index& = 0 To SendMessage(rList, LB_GETCOUNT, 0, 0) - 1
  1163.             ScreenName$ = String$(4, vbNullChar)
  1164.             itmHold& = SendMessage(rList, LB_GETITEMDATA, ByVal CLng(index&), ByVal 0&)
  1165.             itmHold& = itmHold& + 24
  1166.             Call ReadProcessMemory(mThread&, itmHold&, ScreenName$, 4, rBytes)
  1167.             Call CopyMemory(psnHold&, ByVal ScreenName$, 4)
  1168.             psnHold& = psnHold& + 6
  1169.             ScreenName$ = String$(16, vbNullChar)
  1170.             Call ReadProcessMemory(mThread&, psnHold&, ScreenName$, Len(ScreenName$), rBytes&)
  1171.             ScreenName$ = Left$(ScreenName$, InStr(ScreenName$, vbNullChar) - 1)
  1172.             If ScreenName$ <> GetUser$ Or AddUser = True Then
  1173.                 TheCombo.AddItem ScreenName$
  1174.             End If
  1175.         Next index&
  1176.         Call CloseHandle(mThread)
  1177.     End If
  1178.     If TheCombo.ListCount > 0 Then
  1179.         TheCombo.Text = TheCombo.List(0)
  1180.     End If
  1181. End Sub
  1182.  
  1183. Public Sub ChatIgnoreByIndex(index As Long)
  1184.     Dim Room As Long, sList As Long, iWindow As Long
  1185.     Dim iCheck As Long, a As Long, Count As Long
  1186.     Count& = RoomCount&
  1187.     If index& > Count& - 1 Then Exit Sub
  1188.     Room& = FindRoom&
  1189.     sList& = FindWindowEx(Room&, 0&, "_AOL_Listbox", vbNullString)
  1190.     Call SendMessage(sList&, LB_SETCURSEL, index&, 0&)
  1191.     Call PostMessage(sList&, WM_LBUTTONDBLCLK, 0&, 0&)
  1192.     Do
  1193.         DoEvents
  1194.         iWindow& = FindInfoWindow
  1195.     Loop Until iWindow& <> 0&
  1196.     DoEvents
  1197.     iCheck& = FindWindowEx(iWindow&, 0&, "_AOL_Checkbox", vbNullString)
  1198.     DoEvents
  1199.     Do
  1200.         DoEvents
  1201.         a& = SendMessage(iCheck&, BM_GETCHECK, 0&, 0&)
  1202.         Call PostMessage(iCheck&, WM_LBUTTONDOWN, 0&, 0&)
  1203.         DoEvents
  1204.         Call PostMessage(iCheck&, WM_LBUTTONUP, 0&, 0&)
  1205.         DoEvents
  1206.     Loop Until a& <> 0&
  1207.     DoEvents
  1208.     Call PostMessage(iWindow&, WM_CLOSE, 0&, 0&)
  1209. End Sub
  1210.  
  1211. Public Sub ChatIgnoreByName(name As String)
  1212.     On Error Resume Next
  1213.     Dim cProcess As Long, itmHold As Long, ScreenName As String
  1214.     Dim psnHold As Long, rBytes As Long, index As Long, Room As Long
  1215.     Dim rList As Long, sThread As Long, mThread As Long
  1216.     Dim lIndex As Long
  1217.     Room& = FindRoom&
  1218.     If Room& = 0& Then Exit Sub
  1219.     rList& = FindWindowEx(Room&, 0&, "_AOL_Listbox", vbNullString)
  1220.     sThread& = GetWindowThreadProcessId(rList, cProcess&)
  1221.     mThread& = OpenProcess(PROCESS_READ Or RIGHTS_REQUIRED, False, cProcess&)
  1222.     If mThread& Then
  1223.         For index& = 0 To SendMessage(rList, LB_GETCOUNT, 0, 0) - 1
  1224.             ScreenName$ = String$(4, vbNullChar)
  1225.             itmHold& = SendMessage(rList, LB_GETITEMDATA, ByVal CLng(index&), ByVal 0&)
  1226.             itmHold& = itmHold& + 24
  1227.             Call ReadProcessMemory(mThread&, itmHold&, ScreenName$, 4, rBytes)
  1228.             Call CopyMemory(psnHold&, ByVal ScreenName$, 4)
  1229.             psnHold& = psnHold& + 6
  1230.             ScreenName$ = String$(16, vbNullChar)
  1231.             Call ReadProcessMemory(mThread&, psnHold&, ScreenName$, Len(ScreenName$), rBytes&)
  1232.             ScreenName$ = Left$(ScreenName$, InStr(ScreenName$, vbNullChar) - 1)
  1233.             If ScreenName$ <> GetUser$ And LCase(ScreenName$) = LCase(name$) Then
  1234.                 lIndex& = index&
  1235.                 Call ChatIgnoreByIndex(lIndex&)
  1236.                 DoEvents
  1237.                 Exit Sub
  1238.             End If
  1239.         Next index&
  1240.         Call CloseHandle(mThread)
  1241.     End If
  1242. End Sub
  1243.  
  1244. Public Function ChatLineSN(TheChatLine As String) As String
  1245.     If InStr(TheChatLine, ":") = 0 Then
  1246.         ChatLineSN = ""
  1247.         Exit Function
  1248.     End If
  1249.     ChatLineSN = Left(TheChatLine, InStr(TheChatLine, ":") - 1)
  1250. End Function
  1251.  
  1252. Public Function ChatLineMsg(TheChatLine As String) As String
  1253.     If InStr(TheChatLine, Chr(9)) = 0 Then
  1254.         ChatLineMsg = ""
  1255.         Exit Function
  1256.     End If
  1257.     ChatLineMsg = Right(TheChatLine, Len(TheChatLine) - InStr(TheChatLine, Chr(9)))
  1258. End Function
  1259.  
  1260. Public Sub Scroll(ScrollString As String)
  1261.     Dim CurLine As String, Count As Long, ScrollIt As Long
  1262.     Dim sProgress As Long
  1263.     If FindRoom& = 0 Then Exit Sub
  1264.     If ScrollString$ = "" Then Exit Sub
  1265.     Count& = LineCount(ScrollString$)
  1266.     sProgress& = 1
  1267.     For ScrollIt& = 1 To Count&
  1268.         CurLine$ = LineFromString(ScrollString$, ScrollIt&)
  1269.         If Len(CurLine$) > 3 Then
  1270.             If Len(CurLine$) > 92 Then
  1271.                 CurLine$ = Left(CurLine$, 92)
  1272.             End If
  1273.             Call ChatSend(CurLine$)
  1274.             Pause 0.7
  1275.         End If
  1276.         sProgress& = sProgress& + 1
  1277.         If sProgress& > 4 Then
  1278.             sProgress& = 1
  1279.             Pause 0.5
  1280.         End If
  1281.     Next ScrollIt&
  1282. End Sub
  1283.  
  1284. Public Sub WaitForOKOrRoom(Room As String)
  1285.     Dim RoomTitle As String, FullWindow As Long, FullButton As Long
  1286.     Room$ = LCase(ReplaceString(Room$, " ", ""))
  1287.     Do
  1288.         DoEvents
  1289.         RoomTitle$ = GetCaption(FindRoom&)
  1290.         RoomTitle$ = LCase(ReplaceString(Room$, " ", ""))
  1291.         FullWindow& = FindWindow("#32770", "America Online")
  1292.         FullButton& = FindWindowEx(FullWindow&, 0&, "Button", "OK")
  1293.     Loop Until (FullWindow& <> 0& And FullButton& <> 0&) Or Room$ = RoomTitle$
  1294.     DoEvents
  1295.     If FullWindow& <> 0& Then
  1296.         Do
  1297.             DoEvents
  1298.             Call SendMessage(FullButton&, WM_KEYDOWN, VK_SPACE, 0&)
  1299.             Call SendMessage(FullButton&, WM_KEYUP, VK_SPACE, 0&)
  1300.             Call SendMessage(FullButton&, WM_KEYDOWN, VK_SPACE, 0&)
  1301.             Call SendMessage(FullButton&, WM_KEYUP, VK_SPACE, 0&)
  1302.             FullWindow& = FindWindow("#32770", "America Online")
  1303.             FullButton& = FindWindowEx(FullWindow&, 0&, "Button", "OK")
  1304.         Loop Until FullWindow& = 0& And FullButton& = 0&
  1305.     End If
  1306.     DoEvents
  1307. End Sub
  1308.  
  1309. Public Sub MemberRoom(Room As String)
  1310.     Call Keyword("aol://2719:61-2-" & Room$)
  1311. End Sub
  1312.  
  1313. Public Sub PublicRoom(Room As String)
  1314.     Call Keyword("aol://2719:21-2-" & Room$)
  1315. End Sub
  1316.  
  1317. Public Sub PrivateRoom(Room As String)
  1318.     Call Keyword("aol://2719:2-2-" & Room$)
  1319. End Sub
  1320.  
  1321. Public Sub InstantMessage(Person As String, Message As String)
  1322.     Dim AOL As Long, MDI As Long, IM As Long, Rich As Long
  1323.     Dim SendButton As Long, OK As Long, Button As Long
  1324.     AOL& = FindWindow("AOL Frame25", vbNullString)
  1325.     MDI& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString)
  1326.     Call Keyword("aol://9293:" & Person$)
  1327.     Do
  1328.         DoEvents
  1329.         IM& = FindWindowEx(MDI&, 0&, "AOL Child", "Send Instant Message")
  1330.         Rich& = FindWindowEx(IM&, 0&, "RICHCNTL", vbNullString)
  1331.         SendButton& = FindWindowEx(IM&, 0&, "_AOL_Icon", vbNullString)
  1332.         SendButton& = FindWindowEx(IM&, SendButton&, "_AOL_Icon", vbNullString)
  1333.         SendButton& = FindWindowEx(IM&, SendButton&, "_AOL_Icon", vbNullString)
  1334.         SendButton& = FindWindowEx(IM&, SendButton&, "_AOL_Icon", vbNullString)
  1335.         SendButton& = FindWindowEx(IM&, SendButton&, "_AOL_Icon", vbNullString)
  1336.         SendButton& = FindWindowEx(IM&, SendButton&, "_AOL_Icon", vbNullString)
  1337.         SendButton& = FindWindowEx(IM&, SendButton&, "_AOL_Icon", vbNullString)
  1338.         SendButton& = FindWindowEx(IM&, SendButton&, "_AOL_Icon", vbNullString)
  1339.         SendButton& = FindWindowEx(IM&, SendButton&, "_AOL_Icon", vbNullString)
  1340.     Loop Until IM& <> 0& And Rich& <> 0& And SendButton& <> 0&
  1341.     Call SendMessageByString(Rich&, WM_SETTEXT, 0&, Message$)
  1342.     Call SendMessage(SendButton&, WM_LBUTTONDOWN, 0&, 0&)
  1343.     Call SendMessage(SendButton&, WM_LBUTTONUP, 0&, 0&)
  1344.     Do
  1345.         DoEvents
  1346.         OK& = FindWindow("#32770", "America Online")
  1347.         IM& = FindWindowEx(MDI&, 0&, "AOL Child", "Send Instant Message")
  1348.     Loop Until OK& <> 0& Or IM& = 0&
  1349.     If OK& <> 0& Then
  1350.         Button& = FindWindowEx(OK&, 0&, "Button", vbNullString)
  1351.         Call PostMessage(Button&, WM_KEYDOWN, VK_SPACE, 0&)
  1352.         Call PostMessage(Button&, WM_KEYUP, VK_SPACE, 0&)
  1353.         Call PostMessage(IM&, WM_CLOSE, 0&, 0&)
  1354.     End If
  1355. End Sub
  1356.  
  1357. Public Function CheckIMs(Person As String) As Boolean
  1358.     Dim AOL As Long, MDI As Long, IM As Long, Rich As Long
  1359.     Dim Available As Long, Available1 As Long, Available2 As Long
  1360.     Dim Available3 As Long, oWindow As Long, oButton As Long
  1361.     Dim oStatic As Long, oString As String
  1362.     AOL& = FindWindow("AOL Frame25", vbNullString)
  1363.     MDI& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString)
  1364.     Call Keyword("aol://9293:" & Person$)
  1365.     Do
  1366.         DoEvents
  1367.         IM& = FindWindowEx(MDI&, 0&, "AOL Child", "Send Instant Message")
  1368.         Rich& = FindWindowEx(IM&, 0&, "RICHCNTL", vbNullString)
  1369.         Available1& = FindWindowEx(IM&, 0&, "_AOL_Icon", vbNullString)
  1370.         Available2& = FindWindowEx(IM&, Available1&, "_AOL_Icon", vbNullString)
  1371.         Available3& = FindWindowEx(IM&, Available2&, "_AOL_Icon", vbNullString)
  1372.         Available& = FindWindowEx(IM&, Available3&, "_AOL_Icon", vbNullString)
  1373.         Available& = FindWindowEx(IM&, Available&, "_AOL_Icon", vbNullString)
  1374.         Available& = FindWindowEx(IM&, Available&, "_AOL_Icon", vbNullString)
  1375.         Available& = FindWindowEx(IM&, Available&, "_AOL_Icon", vbNullString)
  1376.         Available& = FindWindowEx(IM&, Available&, "_AOL_Icon", vbNullString)
  1377.         Available& = FindWindowEx(IM&, Available&, "_AOL_Icon", vbNullString)
  1378.         Available& = FindWindowEx(IM&, Available&, "_AOL_Icon", vbNullString)
  1379.     Loop Until IM& <> 0& And Rich <> 0& And Available& <> 0& And Available& <> Available1& And Available& <> Available2& And Available& <> Available3&
  1380.     DoEvents
  1381.     Call SendMessage(Available&, WM_LBUTTONDOWN, 0&, 0&)
  1382.     Call SendMessage(Available&, WM_LBUTTONUP, 0&, 0&)
  1383.     Do
  1384.         DoEvents
  1385.         oWindow& = FindWindow("#32770", "America Online")
  1386.         oButton& = FindWindowEx(oWindow&, 0&, "Button", "OK")
  1387.     Loop Until oWindow& <> 0& And oButton& <> 0&
  1388.     Do
  1389.         DoEvents
  1390.         oStatic& = FindWindowEx(oWindow&, 0&, "Static", vbNullString)
  1391.         oStatic& = FindWindowEx(oWindow&, oStatic&, "Static", vbNullString)
  1392.         oString$ = GetText(oStatic)
  1393.     Loop Until oStatic& <> 0& And Len(oString$) > 15
  1394.     If InStr(oString$, "is online and able to receive") <> 0 Then
  1395.         CheckIMs = True
  1396.     Else
  1397.         CheckIMs = False
  1398.     End If
  1399.     Call SendMessage(oButton&, WM_KEYDOWN, VK_SPACE, 0&)
  1400.     Call SendMessage(oButton&, WM_KEYUP, VK_SPACE, 0&)
  1401.     Call PostMessage(IM&, WM_CLOSE, 0&, 0&)
  1402. End Function
  1403.  
  1404. Public Sub IMIgnore(Person As String)
  1405.     Call InstantMessage("$IM_OFF, " & Person$, "=)")
  1406. End Sub
  1407.  
  1408. Public Sub IMUnIgnore(Person As String)
  1409.     Call InstantMessage("$IM_ON, " & Person$, "=)")
  1410. End Sub
  1411.  
  1412. Public Sub IMsOff()
  1413.     Call InstantMessage("$IM_OFF", "=)")
  1414. End Sub
  1415.  
  1416. Public Sub IMsOn()
  1417.     Call InstantMessage("$IM_ON", "=)")
  1418. End Sub
  1419.  
  1420. Public Function IMSender() As String
  1421.     Dim IM As Long, Caption As String
  1422.     Caption$ = GetCaption(FindIM&)
  1423.     If InStr(Caption$, ":") = 0& Then
  1424.         IMSender$ = ""
  1425.         Exit Function
  1426.     Else
  1427.         IMSender$ = Right(Caption$, Len(Caption$) - InStr(Caption$, ":") - 1)
  1428.     End If
  1429. End Function
  1430.  
  1431. Public Function IMText() As String
  1432.     Dim Rich As Long
  1433.     Rich& = FindWindowEx(FindIM&, 0&, "RICHCNTL", vbNullString)
  1434.     IMText$ = GetText(Rich&)
  1435. End Function
  1436.  
  1437. Public Function IMLastMsg() As String
  1438.     Dim Rich As Long, MsgString As String, Spot As Long
  1439.     Dim NewSpot As Long
  1440.     Rich& = FindWindowEx(FindIM&, 0&, "RICHCNTL", vbNullString)
  1441.     MsgString$ = GetText(Rich&)
  1442.     NewSpot& = InStr(MsgString$, Chr(9))
  1443.     Do
  1444.         Spot& = NewSpot&
  1445.         NewSpot& = InStr(Spot& + 1, MsgString$, Chr(9))
  1446.     Loop Until NewSpot& <= 0&
  1447.     MsgString$ = Right(MsgString$, Len(MsgString$) - Spot& - 1)
  1448.     IMLastMsg$ = Left(MsgString$, Len(MsgString$) - 1)
  1449. End Function
  1450.  
  1451. Public Sub IMRespond(Msg As String)
  1452.     Dim IM As Long, Rich As Long, icon As Long
  1453.     IM& = FindIM&
  1454.     If IM& = 0& Then Exit Sub
  1455.     Rich& = FindWindowEx(IM&, 0&, "RICHCNTL", vbNullString)
  1456.     Rich& = FindWindowEx(IM&, Rich&, "RICHCNTL", vbNullString)
  1457.     icon& = FindWindowEx(IM&, 0&, "_AOL_Icon", vbNullString)
  1458.     icon& = FindWindowEx(IM&, icon&, "_AOL_Icon", vbNullString)
  1459.     icon& = FindWindowEx(IM&, icon&, "_AOL_Icon", vbNullString)
  1460.     icon& = FindWindowEx(IM&, icon&, "_AOL_Icon", vbNullString)
  1461.     icon& = FindWindowEx(IM&, icon&, "_AOL_Icon", vbNullString)
  1462.     icon& = FindWindowEx(IM&, icon&, "_AOL_Icon", vbNullString)
  1463.     icon& = FindWindowEx(IM&, icon&, "_AOL_Icon", vbNullString)
  1464.     icon& = FindWindowEx(IM&, icon&, "_AOL_Icon", vbNullString)
  1465.     icon& = FindWindowEx(IM&, icon&, "_AOL_Icon", vbNullString)
  1466.     Call SendMessageByString(Rich&, WM_SETTEXT, 0&, Msg$)
  1467.     DoEvents
  1468.     Call SendMessage(icon&, WM_LBUTTONDOWN, 0&, 0&)
  1469.     Call SendMessage(icon&, WM_LBUTTONUP, 0&, 0&)
  1470. End Sub
  1471.  
  1472. Public Sub Keyword(KW As String)
  1473.     Dim AOL As Long, tool As Long, Toolbar As Long
  1474.     Dim Combo As Long, EditWin As Long
  1475.     AOL& = FindWindow("AOL Frame25", vbNullString)
  1476.     tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
  1477.     Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
  1478.     Combo& = FindWindowEx(Toolbar&, 0&, "_AOL_Combobox", vbNullString)
  1479.     EditWin& = FindWindowEx(Combo&, 0&, "Edit", vbNullString)
  1480.     Call SendMessageByString(EditWin&, WM_SETTEXT, 0&, KW$)
  1481.     Call SendMessageLong(EditWin&, WM_CHAR, VK_SPACE, 0&)
  1482.     Call SendMessageLong(EditWin&, WM_CHAR, VK_RETURN, 0&)
  1483. End Sub
  1484.  
  1485. Public Function DoubleText(MyString As String) As String
  1486.     Dim NewString As String, CurChar As String
  1487.     Dim DoIt As Long
  1488.     If MyString$ <> "" Then
  1489.         For DoIt& = 1 To Len(MyString$)
  1490.             CurChar$ = LineChar(MyString$, DoIt&)
  1491.             NewString$ = NewString$ & CurChar$ & CurChar$
  1492.         Next DoIt&
  1493.         DoubleText$ = NewString$
  1494.     End If
  1495. End Function
  1496.  
  1497. Public Function LineChar(TheText As String, CharNum As Long) As String
  1498.     Dim TextLength As Long, NewText As String
  1499.     TextLength& = Len(TheText$)
  1500.     If CharNum& > TextLength& Then
  1501.         Exit Function
  1502.     End If
  1503.     NewText$ = Left(TheText$, CharNum&)
  1504.     NewText$ = Right(NewText$, 1)
  1505.     LineChar$ = NewText$
  1506. End Function
  1507.  
  1508. Public Function LineCount(MyString As String) As Long
  1509.     Dim Spot As Long, Count As Long
  1510.     If Len(MyString$) < 1 Then
  1511.         LineCount& = 0&
  1512.         Exit Function
  1513.     End If
  1514.     Spot& = InStr(MyString$, Chr(13))
  1515.     If Spot& <> 0& Then
  1516.         LineCount& = 1
  1517.         Do
  1518.             Spot& = InStr(Spot + 1, MyString$, Chr(13))
  1519.             If Spot& <> 0& Then
  1520.                 LineCount& = LineCount& + 1
  1521.             End If
  1522.         Loop Until Spot& = 0&
  1523.     End If
  1524.     LineCount& = LineCount& + 1
  1525. End Function
  1526.  
  1527. Public Function LineFromString(MyString As String, Line As Long) As String
  1528.     Dim theline As String, Count As Long
  1529.     Dim FSpot As Long, LSpot As Long, DoIt As Long
  1530.     Count& = LineCount(MyString$)
  1531.     If Line& > Count& Then
  1532.         Exit Function
  1533.     End If
  1534.     If Line& = 1 And Count& = 1 Then
  1535.         LineFromString$ = MyString$
  1536.         Exit Function
  1537.     End If
  1538.     If Line& = 1 Then
  1539.         theline$ = Left(MyString$, InStr(MyString$, Chr(13)) - 1)
  1540.         theline$ = ReplaceString(theline$, Chr(13), "")
  1541.         theline$ = ReplaceString(theline$, Chr(10), "")
  1542.         LineFromString$ = theline$
  1543.         Exit Function
  1544.     Else
  1545.         FSpot& = InStr(MyString$, Chr(13))
  1546.         For DoIt& = 1 To Line& - 1
  1547.             LSpot& = FSpot&
  1548.             FSpot& = InStr(FSpot& + 1, MyString$, Chr(13))
  1549.         Next DoIt
  1550.         If FSpot = 0 Then
  1551.             FSpot = Len(MyString$)
  1552.         End If
  1553.         theline$ = Mid(MyString$, LSpot&, FSpot& - LSpot& + 1)
  1554.         theline$ = ReplaceString(theline$, Chr(13), "")
  1555.         theline$ = ReplaceString(theline$, Chr(10), "")
  1556.         LineFromString$ = theline$
  1557.     End If
  1558. End Function
  1559.  
  1560. Public Function ReplaceString(MyString As String, ToFind As String, ReplaceWith As String) As String
  1561.     Dim Spot As Long, NewSpot As Long, LeftString As String
  1562.     Dim RightString As String, NewString As String
  1563.     Spot& = InStr(LCase(MyString$), LCase(ToFind))
  1564.     NewSpot& = Spot&
  1565.     Do
  1566.         If NewSpot& > 0& Then
  1567.             LeftString$ = Left(MyString$, NewSpot& - 1)
  1568.             If Spot& + Len(ToFind$) <= Len(MyString$) Then
  1569.                 RightString$ = Right(MyString$, Len(MyString$) - NewSpot& - Len(ToFind$) + 1)
  1570.             Else
  1571.                 RightString = ""
  1572.             End If
  1573.             NewString$ = LeftString$ & ReplaceWith$ & RightString$
  1574.             MyString$ = NewString$
  1575.         Else
  1576.             NewString$ = MyString$
  1577.         End If
  1578.         Spot& = NewSpot& + Len(ReplaceWith$)
  1579.         If Spot& > 0 Then
  1580.             NewSpot& = InStr(Spot&, LCase(MyString$), LCase(ToFind$))
  1581.         End If
  1582.     Loop Until NewSpot& < 1
  1583.     ReplaceString$ = NewString$
  1584. End Function
  1585.  
  1586. Public Function ReverseString(MyString As String) As String
  1587.     Dim TempString As String, StringLength As Long
  1588.     Dim Count As Long, NextChr As String, NewString As String
  1589.     TempString$ = MyString$
  1590.     StringLength& = Len(TempString$)
  1591.     Do While Count& <= StringLength&
  1592.         Count& = Count& + 1
  1593.         NextChr$ = Mid$(TempString$, Count&, 1)
  1594.         NewString$ = NextChr$ & NewString$
  1595.     Loop
  1596.     ReverseString$ = NewString$
  1597. End Function
  1598.  
  1599. Public Function SwitchStrings(MyString As String, String1 As String, String2 As String) As String
  1600.     Dim TempString As String, Spot1 As Long, Spot2 As Long
  1601.     Dim Spot As Long, ToFind As String, ReplaceWith As String
  1602.     Dim NewSpot As Long, LeftString As String, RightString As String
  1603.     Dim NewString As String
  1604.     If Len(String2) > Len(String1) Then
  1605.         TempString$ = String1$
  1606.         String1$ = String2$
  1607.         String2$ = TempString$
  1608.     End If
  1609.     Spot1& = InStr(MyString$, String1$)
  1610.     Spot2& = InStr(MyString$, String2$)
  1611.     If Spot1& = 0& And Spot2& = 0& Then
  1612.         SwitchStrings$ = MyString$
  1613.         Exit Function
  1614.     End If
  1615.     If Spot1& < Spot2& Or Spot2& = 0 Or Len(String1$) = Len(String2$) Then
  1616.         If Spot1& > 0 Then
  1617.             Spot& = Spot1&
  1618.             ToFind$ = String1$
  1619.             ReplaceWith$ = String2$
  1620.         End If
  1621.     End If
  1622.     If Spot2& < Spot1& Or Spot1& = 0& Then
  1623.         If Spot2& > 0& Then
  1624.             Spot& = Spot2&
  1625.             ToFind$ = String2$
  1626.             ReplaceWith$ = String1$
  1627.         End If
  1628.     End If
  1629.     If Spot1& = 0& And Spot2& = 0& Then
  1630.         SwitchStrings$ = MyString$
  1631.         Exit Function
  1632.     End If
  1633.     NewSpot& = Spot&
  1634.     Do
  1635.         If NewSpot& > 0& Then
  1636.             LeftString$ = Left(MyString$, NewSpot& - 1)
  1637.             If Spot& + Len(ToFind$) <= Len(MyString$) Then
  1638.                 RightString$ = Right(MyString$, Len(MyString$) - NewSpot& - Len(ToFind$) + 1)
  1639.             Else
  1640.                 RightString$ = ""
  1641.             End If
  1642.             NewString$ = LeftString$ & ReplaceWith$ & RightString$
  1643.             MyString$ = NewString$
  1644.         Else
  1645.             NewString$ = MyString$
  1646.         End If
  1647.         Spot& = NewSpot + Len(ReplaceWith$) - Len(ToFind$) + 1
  1648.         If Spot& <> 0& Then
  1649.             Spot1& = InStr(Spot&, MyString$, String1$)
  1650.             Spot2& = InStr(Spot&, MyString$, String2$)
  1651.         End If
  1652.         If Spot1& = 0& And Spot2& = 0& Then
  1653.             SwitchStrings$ = MyString$
  1654.             Exit Function
  1655.         End If
  1656.         If Spot1& < Spot2& Or Spot2& = 0& Or Len(String1$) = Len(String2$) Then
  1657.             If Spot1& > 0& Then
  1658.                 Spot& = Spot1&
  1659.                 ToFind$ = String1$
  1660.                 ReplaceWith$ = String2$
  1661.             End If
  1662.         End If
  1663.         If Spot2& < Spot1& Or Spot1& = 0& Then
  1664.             If Spot2& > 0& Then
  1665.                 Spot& = Spot2&
  1666.                 ToFind$ = String2$
  1667.                 ReplaceWith$ = String1$
  1668.             End If
  1669.         End If
  1670.         If Spot1& = 0& And Spot2& = 0& Then
  1671.             Spot& = 0&
  1672.         End If
  1673.         If Spot& > 0& Then
  1674.             NewSpot& = InStr(Spot&, MyString$, ToFind$)
  1675.         Else
  1676.             NewSpot& = Spot&
  1677.         End If
  1678.     Loop Until NewSpot& < 1&
  1679.     SwitchStrings$ = NewString$
  1680. End Function
  1681.  
  1682. Public Function MacroFilter_BCurve(MyString As String) As String
  1683.     MyString$ = ReplaceString(MyString$, "\", "]")
  1684.     MyString$ = ReplaceString(MyString$, "/", "[")
  1685.     MacroFilter_BCurve$ = MyString$
  1686. End Function
  1687.  
  1688. Public Function MacroFilter_BubbleTop(MyString As String) As String
  1689.     MyString$ = ReplaceString(MyString$, "»»»", "░'░'░'")
  1690.     MacroFilter_BubbleTop$ = MyString$
  1691. End Function
  1692.  
  1693. Public Function MacroFilter_BubbleTop2(MyString As String) As String
  1694.     MyString$ = ReplaceString(MyString$, "»»»", "║░░░'")
  1695.     MacroFilter_BubbleTop2$ = MyString$
  1696. End Function
  1697.  
  1698. Public Function MacroFilter_ClawTop(MyString As String) As String
  1699.     MyString$ = ReplaceString(MyString$, "»»»»»»", "»\(»)/" & Chr(34) & "»")
  1700.     MacroFilter_ClawTop$ = MyString$
  1701. End Function
  1702.  
  1703. Public Function MacroFilter_Curve(MyString As String) As String
  1704.     MyString$ = ReplaceString(MyString$, "\", ")")
  1705.     MyString$ = ReplaceString(MyString$, "/", "(")
  1706.     MacroFilter_Curve$ = MyString$
  1707. End Function
  1708.  
  1709. Public Function MacroFilter_CurveBottom(MyString As String) As String
  1710.     MyString$ = ReplaceString(MyString$, "___", "ε,ε,ε,")
  1711.     MacroFilter_CurveBottom$ = MyString$
  1712. End Function
  1713.  
  1714. Public Function MacroFilter_Darken(MyString As String) As String
  1715.     MyString$ = ReplaceString(MyString$, "ª", "|")
  1716.     MyString$ = ReplaceString(MyString$, ",┤", "/ ")
  1717.     MyString$ = ReplaceString(MyString$, "`,", " \")
  1718.     MyString$ = ReplaceString(MyString$, ":", ";")
  1719.     MacroFilter_Darken$ = MyString$
  1720. End Function
  1721.  
  1722. Public Function MacroFilter_Destroy(MyString As String) As String
  1723.     MyString$ = ReplaceString(MyString$, " ", "")
  1724.     MacroFilter_Destroy$ = MyString$
  1725. End Function
  1726.  
  1727. Public Function MacroFilter_DrippingTop(MyString As String) As String
  1728.     MyString$ = ReplaceString(MyString$, "»»»»»", "»\,/»'v'")
  1729.     MacroFilter_DrippingTop$ = MyString$
  1730. End Function
  1731.  
  1732. Public Function MacroFilter_Electric(MyString As String) As String
  1733.     MyString$ = ReplaceString(MyString$, "      |", "--^v^|")
  1734.     MyString$ = ReplaceString(MyString$, "|      ", "|^v^--")
  1735.     MacroFilter_Electric$ = MyString$
  1736. End Function
  1737.  
  1738. Public Function MacroFilter_FireyBottom(MyString As String) As String
  1739.     MyString$ = ReplaceString(MyString$, "___", "_')\.")
  1740.     MacroFilter_FireyBottom$ = MyString$
  1741. End Function
  1742.  
  1743. Public Function MacroFilter_Ghost(MyString As String) As String
  1744.     MyString$ = ReplaceString(MyString$, "»", "¿¿")
  1745.     MyString$ = ReplaceString(MyString$, "/", ".╖")
  1746.     MyString$ = ReplaceString(MyString$, "\", "╖.")
  1747.     MyString$ = ReplaceString(MyString$, "|", ":")
  1748.     MyString$ = ReplaceString(MyString$, "_", "..")
  1749.     MyString$ = ReplaceString(MyString$, "ª", ":")
  1750.     MacroFilter_Ghost = MyString$
  1751. End Function
  1752.  
  1753. Public Function MacroFilter_Indent(MyString As String) As String
  1754.     Dim NewLine As String, OrgLen As Long, NumOfLines As Long
  1755.     Dim OrgCount As Long, SpaceIt As Long, CurLine As String
  1756.     Dim NewString As String
  1757.     NewLine$ = Chr(13) & Chr(10)
  1758.     OrgLen& = Len(MyString$)
  1759.     MyString$ = MyString$ & NewLine$
  1760.     NumOfLines& = LineCount(MyString$)
  1761.     OrgCount& = NumOfLines&
  1762.     For SpaceIt& = 1 To NumOfLines&
  1763.         DoEvents
  1764.         CurLine$ = LineFromString(MyString$, SpaceIt&)
  1765.         NewString$ = NewString$ & " " & CurLine$ & NewLine$
  1766.     Next SpaceIt&
  1767.     MyString$ = Left(NewString$, OrgLen& + OrgCount& - 1)
  1768.     MacroFilter_Indent$ = MyString$
  1769. End Function
  1770.  
  1771. Public Function MacroFilter_JaG(MyString As String) As String
  1772.     MyString$ = ReplaceString(MyString$, "»»»»", "»`v┤»")
  1773.     MacroFilter_JaG$ = MyString$
  1774. End Function
  1775.  
  1776. Public Function MacroFilter_Lighten(MyString As String) As String
  1777.     MyString$ = ReplaceString(MyString$, "|", "ª")
  1778.     MyString$ = ReplaceString(MyString$, "/ ", ",┤")
  1779.     MyString$ = ReplaceString(MyString$, "\ ", "`,")
  1780.     MyString$ = ReplaceString(MyString$, " /", ",┤")
  1781.     MyString$ = ReplaceString(MyString$, " \", "`,")
  1782.     MyString$ = ReplaceString(MyString$, ";", ":")
  1783.     MacroFilter_Lighten$ = MyString$
  1784. End Function
  1785.  
  1786. Public Function MacroFilter_PCurve(MyString As String) As String
  1787.     MyString$ = ReplaceString(MyString$, "\", "}")
  1788.     MyString$ = ReplaceString(MyString$, "/", "{")
  1789.     MacroFilter_PCurve$ = MyString$
  1790. End Function
  1791.  
  1792. Public Function MacroFilter_PsYTop(MyString As String) As String
  1793.     MyString$ = ReplaceString(MyString$, "»»»", "`'»`ô")
  1794.     MacroFilter_PsYTop$ = MyString$
  1795. End Function
  1796.  
  1797. Public Function MacroFilter_RandomBottom(MyString As String) As String
  1798.     MyString$ = ReplaceString(MyString$, "___", "-éäé╕é")
  1799.     MacroFilter_RandomBottom$ = MyString$
  1800. End Function
  1801.  
  1802. Public Function MacroFilter_Rapid(MyString As String) As String
  1803.     MyString$ = ReplaceString(MyString$, "   |", "-=|")
  1804.     MyString$ = ReplaceString(MyString$, "|   ", "|=-")
  1805.     MacroFilter_Rapid$ = MyString$
  1806. End Function
  1807.  
  1808. Public Function MacroFilter_ReplaceLines(MyString As String) As String
  1809.     MyString$ = ReplaceString(MyString$, "|", "ª")
  1810.     MacroFilter_ReplaceLines$ = MyString$
  1811. End Function
  1812.  
  1813. Public Function MacroFilter_ReplaceSlants(MyString As String) As String
  1814.     MyString$ = ReplaceString(MyString$, "/ ", ",┤")
  1815.     MyString$ = ReplaceString(MyString$, "\ ", "`,")
  1816.     MyString$ = ReplaceString(MyString$, " /", ",┤")
  1817.     MyString$ = ReplaceString(MyString$, " \", "`,")
  1818.     MacroFilter_ReplaceSlants$ = MyString$
  1819. End Function
  1820.  
  1821. Public Function MacroFilter_Reverse(MyString As String) As String
  1822.     Dim CurChar As Long, NewLine As String, MyText As String
  1823.     Dim NumOfLines As Long, ReverseIt As Long, CheckLen As Long
  1824.     Dim CurLine As String, NewString As String
  1825.     If MyString$ <> "" Then
  1826.         NewLine$ = Chr(13) & Chr(10)
  1827.         MyText$ = MyString$ & NewLine$
  1828.         NumOfLines& = LineCount(MyText$)
  1829.         For ReverseIt& = 1 To NumOfLines
  1830.             CurLine$ = LineFromString(MyText$, ReverseIt&)
  1831.             CurLine$ = ReverseString(CurLine$)
  1832.             NewString$ = NewString$ & CurLine$ & NewLine$
  1833.         Next ReverseIt&
  1834.         NewString$ = SwitchStrings(NewString$, "/", "\")
  1835.         NewString$ = SwitchStrings(NewString$, "[", "]")
  1836.         NewString$ = SwitchStrings(NewString$, "{", "}")
  1837.         NewString$ = SwitchStrings(NewString$, "(", ")")
  1838.         NewString$ = SwitchStrings(NewString$, "½", "╗")
  1839.         NewString$ = SwitchStrings(NewString$, "ï", "¢")
  1840.         NewString$ = SwitchStrings(NewString$, "<", ">")
  1841.         CheckLen& = Len(NewString$)
  1842.         NewString$ = Left(NewString$, CheckLen& - 4)
  1843.         MacroFilter_Reverse$ = NewString$
  1844.     End If
  1845. End Function
  1846.  
  1847. Public Function MacroFilter_RoundedTop(MyString As String) As String
  1848.     MyString$ = ReplaceString(MyString$, "|»»", "|'ÿ»")
  1849.     MyString$ = ReplaceString(MyString$, "ª»»", "ª'ÿ»")
  1850.     MacroFilter_RoundedTop$ = MyString$
  1851. End Function
  1852.  
  1853. Public Function MacroFilter_Shadow(MyString As String) As String
  1854.     MyString$ = ReplaceString(MyString$, " |", ";|")
  1855.     MyString$ = ReplaceString(MyString$, "| ", "|;")
  1856.     MacroFilter_Shadow$ = MyString$
  1857. End Function
  1858.  
  1859. Public Function MacroFilter_Smear(MyString As String) As String
  1860.     MyString$ = ReplaceString(MyString$, "|", "ª")
  1861.     MyString$ = ReplaceString(MyString$, "   ª", ".:;ª")
  1862.     MyString$ = ReplaceString(MyString$, "  ª", ":;ª")
  1863.     MyString$ = ReplaceString(MyString$, " ª", ";ª")
  1864.     MyString$ = ReplaceString(MyString$, "   /", ".:;/")
  1865.     MyString$ = ReplaceString(MyString$, "  /", ":;/")
  1866.     MyString$ = ReplaceString(MyString$, " /", ";/")
  1867.     MyString$ = ReplaceString(MyString$, "   \", ".:;\")
  1868.     MyString$ = ReplaceString(MyString$, "  \", ":;\")
  1869.     MyString$ = ReplaceString(MyString$, " \", ";\")
  1870.     MyString$ = ReplaceString(MyString$, "   '", ".:;'")
  1871.     MyString$ = ReplaceString(MyString$, "  '", ":;'")
  1872.     MyString$ = ReplaceString(MyString$, " '", ";'")
  1873.     MacroFilter_Smear$ = MyString$
  1874. End Function
  1875.  
  1876. Public Function MacroFilter_SpikeBottom(MyString As String) As String
  1877.     MyString$ = ReplaceString(MyString$, "___", "╕í╕í╕í")
  1878.     MacroFilter_SpikeBottom$ = MyString$
  1879. End Function
  1880.  
  1881. Public Function MacroFilter_Straighten(MyString As String) As String
  1882.     MyString$ = ReplaceString(MyString$, "}", "\")
  1883.     MyString$ = ReplaceString(MyString$, "{", "/")
  1884.     MyString$ = ReplaceString(MyString$, "]", "\")
  1885.     MyString$ = ReplaceString(MyString$, "[", "/")
  1886.     MyString$ = ReplaceString(MyString$, ")", "\")
  1887.     MyString$ = ReplaceString(MyString$, "(", "/")
  1888.     MacroFilter_Straighten$ = MyString$
  1889. End Function
  1890.  
  1891. Public Function MacroFilter_Stretch(MyString As String) As String
  1892.     Dim CurChar As Long, StretchIt As Long, MyText As String
  1893.     Dim NewLine As String, NumOfLines As Long, CheckLen As Long
  1894.     Dim CurLine As String, NewString As String
  1895.     If MyString$ <> "" Then
  1896.         NewLine$ = Chr(13) & Chr(10)
  1897.         MyText$ = MyString$ & NewLine$
  1898.         NumOfLines& = LineCount(MyText$)
  1899.         For StretchIt& = 1 To NumOfLines&
  1900.             CurLine$ = LineFromString(MyText, StretchIt&)
  1901.             CurLine$ = DoubleText(CurLine$)
  1902.             NewString$ = NewString$ & CurLine$ & NewLine$
  1903.         Next StretchIt&
  1904.         CheckLen& = Len(NewString$)
  1905.         NewString$ = Left(NewString$, CheckLen& - 4)
  1906.         MacroFilter_Stretch$ = NewString$
  1907.     End If
  1908. End Function
  1909.  
  1910. Public Function MacroFilter_StarTop(MyString As String) As String
  1911.     MyString$ = ReplaceString(MyString$, "»»»", "`**»")
  1912.     MacroFilter_StarTop$ = MyString$
  1913. End Function
  1914.  
  1915. Public Function MacroFilter_ThickenBottom(MyString As String) As String
  1916.     MyString$ = ReplaceString(MyString$, "___", "╕é╕é╕é")
  1917.     MacroFilter_ThickenBottom$ = MyString$
  1918. End Function
  1919.  
  1920. Public Function MacroFilter_ThickenTop(MyString As String) As String
  1921.     MyString$ = ReplaceString(MyString$, "»»»", "öæöæöæ")
  1922.     MacroFilter_ThickenTop$ = MyString$
  1923. End Function
  1924.  
  1925. Public Function MacroFilter_TreadTop(MyString As String) As String
  1926.     MyString$ = ReplaceString(MyString$, "»»»", "¬æ¬æ¬æ")
  1927.     MacroFilter_TreadTop$ = MyString$
  1928. End Function
  1929.  
  1930. Public Function MacroFilter_UnIndent(MyString As String) As String
  1931.     Dim OrgLen As Long, NewLine As String, NumOfLines As Long
  1932.     Dim OrgCount As Long, CurLine As String, NewString As String
  1933.     Dim SpaceIt As Long
  1934.     OrgLen& = Len(MyString$)
  1935.     NewLine$ = Chr(13) & Chr(10)
  1936.     MyString$ = MyString$ & NewLine$
  1937.     NumOfLines& = LineCount(MyString)
  1938.     OrgCount& = NumOfLines&
  1939.     For SpaceIt& = 1 To NumOfLines&
  1940.         CurLine$ = LineFromString(MyString$, SpaceIt&)
  1941.         If Len(CurLine$) < 1 Then
  1942.             NewString$ = NewString$ & CurLine$ & NewLine$
  1943.         Else
  1944.             NewString$ = NewString$ & Right(CurLine$, Len(CurLine$) - 1) & NewLine$
  1945.         End If
  1946.     Next SpaceIt&
  1947.     MyString$ = Left(NewString$, Len(NewString$) - 4)
  1948.     MacroFilter_UnIndent$ = MyString$
  1949. End Function
  1950.  
  1951. Public Function MacroFilter_UpsideDown(MyString As String) As String
  1952.     Dim CharCheck As Long, CurChar As Long, CurLine As String
  1953.     Dim FlipIt As Long, MyLine As Long, MyText As String
  1954.     Dim NewLine As String, NumOfLines As Long
  1955.     Dim CheckLen As Long, NewString As String
  1956.     If MyString$ <> "" Then
  1957.         NewLine$ = Chr(13) & Chr(10)
  1958.         MyText$ = MyString$ & NewLine$
  1959.         NumOfLines& = LineCount(MyText$)
  1960.         MyLine& = NumOfLines& - 1
  1961.         For FlipIt& = 1 To NumOfLines&
  1962.             DoEvents
  1963.             CurLine$ = LineFromString(MyText$, MyLine&)
  1964.             NewString$ = NewString$ & CurLine$ & NewLine$
  1965.             MyLine& = MyLine& - 1
  1966.         Next FlipIt&
  1967.         NewString$ = Left(NewString$, Len(NewString$) - 4)
  1968.         MyString$ = NewString$
  1969.         CheckLen& = Len(NewString$)
  1970.         NewString$ = SwitchStrings(MyString$, "/", "\")
  1971.         MyString$ = SwitchStrings(MyString$, "»", "_")
  1972.         MyString$ = SwitchStrings(MyString$, ",", "'")
  1973.         MyString$ = ReplaceString(MyString$, ",,", ",")
  1974.         MyString$ = ReplaceString(MyString$, "`", ",")
  1975.         MyString$ = SwitchStrings(MyString$, "┤", ".")
  1976.         MyString$ = ReplaceString(MyString$, "æ", ".")
  1977.         MyString$ = ReplaceString(MyString$, "Æ", ",")
  1978.         MyString$ = SwitchStrings(MyString$, "ê", "╕")
  1979.         MyString$ = SwitchStrings(MyString$, "ä", Chr(34))
  1980.         MacroFilter_UpsideDown$ = MyString$
  1981.     End If
  1982. End Function
  1983.  
  1984. Public Function FileExists(sFileName As String) As Boolean
  1985.     If Len(sFileName$) = 0 Then
  1986.         FileExists = False
  1987.         Exit Function
  1988.     End If
  1989.     If Len(Dir$(sFileName$)) Then
  1990.         FileExists = True
  1991.     Else
  1992.         FileExists = False
  1993.     End If
  1994. End Function
  1995.  
  1996. Sub LoadText(txtLoad As TextBox, Path As String)
  1997.     Dim TextString As String
  1998.     On Error Resume Next
  1999.     Open Path$ For Input As #1
  2000.     TextString$ = Input(LOF(1), #1)
  2001.     Close #1
  2002.     txtLoad.Text = TextString$
  2003. End Sub
  2004.  
  2005. Sub SaveText(txtSave As TextBox, Path As String)
  2006.     Dim TextString As String
  2007.     On Error Resume Next
  2008.     TextString$ = txtSave.Text
  2009.     Open Path$ For Output As #1
  2010.     Print #1, TextString$
  2011.     Close #1
  2012. End Sub
  2013.  
  2014. Public Sub Loadlistbox(Directory As String, TheList As ListBox)
  2015.     Dim MyString As String
  2016.     On Error Resume Next
  2017.     Open Directory$ For Input As #1
  2018.     While Not EOF(1)
  2019.         Input #1, MyString$
  2020.         DoEvents
  2021.         TheList.AddItem MyString$
  2022.     Wend
  2023.     Close #1
  2024. End Sub
  2025.  
  2026. Public Sub Load2listboxes(Directory As String, ListA As ListBox, ListB As ListBox)
  2027.     Dim MyString As String, aString As String, bString As String
  2028.     On Error Resume Next
  2029.     Open Directory$ For Input As #1
  2030.     While Not EOF(1)
  2031.         Input #1, MyString$
  2032.         aString$ = Left(MyString$, InStr(MyString$, "*") - 1)
  2033.         bString$ = Right(MyString$, Len(MyString$) - InStr(MyString$, "*"))
  2034.         DoEvents
  2035.         ListA.AddItem aString$
  2036.         ListB.AddItem bString$
  2037.     Wend
  2038.     Close #1
  2039. End Sub
  2040.  
  2041. Public Sub SaveListBox(Directory As String, TheList As ListBox)
  2042.     Dim SaveList As Long
  2043.     On Error Resume Next
  2044.     Open Directory$ For Output As #1
  2045.     For SaveList& = 0 To TheList.ListCount - 1
  2046.         Print #1, TheList.List(SaveList&)
  2047.     Next SaveList&
  2048.     Close #1
  2049. End Sub
  2050.  
  2051. Public Sub Save2ListBoxes(Directory As String, ListA As ListBox, ListB As ListBox)
  2052.     Dim SaveLists As Long
  2053.     On Error Resume Next
  2054.     Open Directory$ For Output As #1
  2055.     For SaveLists& = 0 To ListA.ListCount - 1
  2056.         Print #1, ListA.List(SaveLists&) & "*" & ListB.List(SaveLists)
  2057.     Next SaveLists&
  2058.     Close #1
  2059. End Sub
  2060.  
  2061. Public Sub SaveComboBox(ByVal Directory As String, Combo As ComboBox)
  2062.     Dim SaveCombo As Long
  2063.     On Error Resume Next
  2064.     Open Directory$ For Output As #1
  2065.     For SaveCombo& = 0 To Combo.ListCount - 1
  2066.         Print #1, Combo.List(SaveCombo&)
  2067.     Next SaveCombo&
  2068.     Close #1
  2069. End Sub
  2070.  
  2071. Public Sub LoadComboBox(ByVal Directory As String, Combo As ComboBox)
  2072.     Dim MyString As String
  2073.     On Error Resume Next
  2074.     Open Directory$ For Input As #1
  2075.     While Not EOF(1)
  2076.         Input #1, MyString$
  2077.         DoEvents
  2078.         Combo.AddItem MyString$
  2079.     Wend
  2080.     Close #1
  2081. End Sub
  2082.  
  2083. Public Function FileGetAttributes(TheFile As String) As Integer
  2084.     Dim SafeFile As String
  2085.     SafeFile$ = Dir(TheFile$)
  2086.     If SafeFile$ <> "" Then
  2087.         FileGetAttributes% = GetAttr(TheFile$)
  2088.     End If
  2089. End Function
  2090.  
  2091. Public Sub FileSetNormal(TheFile As String)
  2092.     Dim SafeFile As String
  2093.     SafeFile$ = Dir(TheFile$)
  2094.     If SafeFile$ <> "" Then
  2095.         SetAttr TheFile$, vbNormal
  2096.     End If
  2097. End Sub
  2098.  
  2099. Public Sub FileSetReadOnly(TheFile As String)
  2100.     Dim SafeFile As String
  2101.     SafeFile$ = Dir(TheFile$)
  2102.     If SafeFile$ <> "" Then
  2103.         SetAttr TheFile$, vbReadOnly
  2104.     End If
  2105. End Sub
  2106.  
  2107. Public Sub FileSetHidden(TheFile As String)
  2108.     Dim SafeFile As String
  2109.     SafeFile$ = Dir(TheFile$)
  2110.     If SafeFile$ <> "" Then
  2111.         SetAttr TheFile$, vbHidden
  2112.     End If
  2113. End Sub
  2114.  
  2115. Public Function GetFromINI(Section As String, Key As String, Directory As String) As String
  2116.    Dim strBuffer As String
  2117.    strBuffer = String(750, Chr(0))
  2118.    Key$ = LCase$(Key$)
  2119.    GetFromINI$ = Left(strBuffer, GetPrivateProfileString(Section$, ByVal Key$, "", strBuffer, Len(strBuffer), Directory$))
  2120. End Function
  2121.  
  2122. Public Sub WriteToINI(Section As String, Key As String, KeyValue As String, Directory As String)
  2123.     Call WritePrivateProfileString(Section$, UCase$(Key$), KeyValue$, Directory$)
  2124. End Sub
  2125.  
  2126. Public Function CheckIfMaster() As Boolean
  2127.     Dim AOL As Long, MDI As Long, pWindow As Long
  2128.     Dim pButton As Long, Modal As Long, mStatic As Long
  2129.     Dim mString As String
  2130.     AOL& = FindWindow("AOL Frame25", vbNullString)
  2131.     MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
  2132.     Call Keyword("aol://4344:1580.prntcon.12263709.564517913")
  2133.     Do
  2134.         DoEvents
  2135.         pWindow& = FindWindowEx(MDI&, 0&, "AOL Child", "Parental Controls")
  2136.         pButton& = FindWindowEx(pWindow&, 0&, "_AOL_Icon", vbNullString)
  2137.     Loop Until pWindow& <> 0& And pButton& <> 0&
  2138.     Pause 0.3
  2139.     Do
  2140.         DoEvents
  2141.         Call PostMessage(pButton&, WM_LBUTTONDOWN, 0&, 0&)
  2142.         Call PostMessage(pButton&, WM_LBUTTONUP, 0&, 0&)
  2143.         Pause 0.8
  2144.         Modal& = FindWindow("_AOL_Modal", vbNullString)
  2145.         mStatic& = FindWindowEx(Modal&, 0&, "_AOL_Static", vbNullString)
  2146.         mString$ = GetText(mStatic&)
  2147.     Loop Until Modal& <> 0 And mStatic& <> 0& And mString$ <> ""
  2148.     mString$ = ReplaceString(mString$, Chr(10), "")
  2149.     mString$ = ReplaceString(mString$, Chr(13), "")
  2150.     If mString$ = "Set Parental Controls" Then
  2151.         CheckIfMaster = True
  2152.     Else
  2153.         CheckIfMaster = False
  2154.     End If
  2155.     Call PostMessage(Modal&, WM_CLOSE, 0&, 0&)
  2156.     DoEvents
  2157.     Call PostMessage(pWindow&, WM_CLOSE, 0&, 0&)
  2158. End Function
  2159.  
  2160. Public Function GetCaption(WindowHandle As Long) As String
  2161.     Dim buffer As String, TextLength As Long
  2162.     TextLength& = GetWindowTextLength(WindowHandle&)
  2163.     buffer$ = String(TextLength&, 0&)
  2164.     Call GetWindowText(WindowHandle&, buffer$, TextLength& + 1)
  2165.     GetCaption$ = buffer$
  2166. End Function
  2167.  
  2168. Public Function GetListText(WindowHandle As Long) As String
  2169.     Dim buffer As String, TextLength As Long
  2170.     TextLength& = SendMessage(WindowHandle&, LB_GETTEXTLEN, 0&, 0&)
  2171.     buffer$ = String(TextLength&, 0&)
  2172.     Call SendMessageByString(WindowHandle&, LB_GETTEXT, TextLength& + 1, buffer$)
  2173.     GetListText$ = buffer$
  2174. End Function
  2175.  
  2176. Public Function GetText(WindowHandle As Long) As String
  2177.     Dim buffer As String, TextLength As Long
  2178.     TextLength& = SendMessage(WindowHandle&, WM_GETTEXTLENGTH, 0&, 0&)
  2179.     buffer$ = String(TextLength&, 0&)
  2180.     Call SendMessageByString(WindowHandle&, WM_GETTEXT, TextLength& + 1, buffer$)
  2181.     GetText$ = buffer$
  2182. End Function
  2183.  
  2184. Public Sub Button(mButton As Long)
  2185.     Call SendMessage(mButton&, WM_KEYDOWN, VK_SPACE, 0&)
  2186.     Call SendMessage(mButton&, WM_KEYUP, VK_SPACE, 0&)
  2187. End Sub
  2188.  
  2189. Public Sub icon(aIcon As Long)
  2190.     Call SendMessage(aIcon&, WM_LBUTTONDOWN, 0&, 0&)
  2191.     Call SendMessage(aIcon&, WM_LBUTTONUP, 0&, 0&)
  2192. End Sub
  2193.  
  2194. Public Sub CloseWindow(Window As Long)
  2195.     Call PostMessage(Window&, WM_CLOSE, 0&, 0&)
  2196. End Sub
  2197.  
  2198. Public Function ProfileGet(ScreenName As String) As String
  2199.     Dim AOL As Long, tool As Long, Toolbar As Long
  2200.     Dim ToolIcon As Long, DoThis As Long, sMod As Long
  2201.     Dim MDI As Long, pgWindow As Long, pgEdit As Long, pgButton As Long
  2202.     Dim pWindow As Long, pTextWindow As Long, pString As String
  2203.     Dim NoWindow As Long, OKButton As Long, CurPos As POINTAPI
  2204.     Dim WinVis As Long
  2205.     AOL& = FindWindow("AOL Frame25", vbNullString)
  2206.     MDI& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString)
  2207.     tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
  2208.     Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
  2209.     ToolIcon& = FindWindowEx(Toolbar&, 0&, "_AOL_Icon", vbNullString)
  2210.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  2211.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  2212.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  2213.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  2214.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  2215.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  2216.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  2217.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  2218.     ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
  2219.     Call GetCursorPos(CurPos)
  2220.     Call SetCursorPos(Screen.width, Screen.height)
  2221.     Call PostMessage(ToolIcon&, WM_LBUTTONDOWN, 0&, 0&)
  2222.     Call PostMessage(ToolIcon&, WM_LBUTTONUP, 0&, 0&)
  2223.     Do
  2224.         sMod& = FindWindow("#32768", vbNullString)
  2225.         WinVis& = IsWindowVisible(sMod&)
  2226.     Loop Until WinVis& = 1
  2227.     Call PostMessage(sMod&, WM_KEYDOWN, VK_UP, 0&)
  2228.     Call PostMessage(sMod&, WM_KEYUP, VK_UP, 0&)
  2229.     Call PostMessage(sMod&, WM_KEYDOWN, VK_UP, 0&)
  2230.     Call PostMessage(sMod&, WM_KEYUP, VK_UP, 0&)
  2231.     Call PostMessage(sMod&, WM_KEYDOWN, VK_RETURN, 0&)
  2232.     Call PostMessage(sMod&, WM_KEYUP, VK_RETURN, 0&)
  2233.     Call SetCursorPos(CurPos.X, CurPos.Y)
  2234.     Do
  2235.         DoEvents
  2236.         pgWindow& = FindWindowEx(MDI&, 0&, "AOL Child", "Get a Member's Profile")
  2237.         pgEdit& = FindWindowEx(pgWindow&, 0&, "_AOL_Edit", vbNullString)
  2238.         pgButton& = FindWindowEx(pgWindow&, 0&, "_AOL_Icon", vbNullString)
  2239.     Loop Until pgWindow& <> 0& And pgEdit& <> 0& And pgButton& <> 0&
  2240.     Call SendMessageByString(pgEdit&, WM_SETTEXT, 0&, ScreenName$)
  2241.     Call SendMessage(pgButton&, WM_LBUTTONDOWN, 0&, 0&)
  2242.     Call SendMessage(pgButton&, WM_LBUTTONUP, 0&, 0&)
  2243.     DoEvents
  2244.     Do
  2245.         DoEvents
  2246.         pWindow& = FindWindowEx(MDI&, 0&, "AOL Child", "Member Profile")
  2247.         pTextWindow& = FindWindowEx(pWindow&, 0&, "_AOL_View", vbNullString)
  2248.         pString$ = GetText(pTextWindow&)
  2249.         NoWindow& = FindWindow("#32770", "America Online")
  2250.     Loop Until pWindow& <> 0& And pTextWindow& <> 0& Or NoWindow& <> 0&
  2251.     DoEvents
  2252.     If NoWindow& <> 0& Then
  2253.         OKButton& = FindWindowEx(NoWindow&, 0&, "Button", "OK")
  2254.         Call SendMessage(OKButton&, WM_KEYDOWN, VK_SPACE, 0&)
  2255.         Call SendMessage(OKButton&, WM_KEYUP, VK_SPACE, 0&)
  2256.         Call PostMessage(pgWindow&, WM_CLOSE, 0&, 0&)
  2257.         ProfileGet$ = "< No Profile >"
  2258.     Else
  2259.         Call PostMessage(pWindow&, WM_CLOSE, 0&, 0&)
  2260.         Call PostMessage(pgWindow&, WM_CLOSE, 0&, 0&)
  2261.         ProfileGet$ = pString$
  2262.     End If
  2263. End Function
  2264.  
  2265. Public Function GetUser() As String
  2266.     Dim AOL As Long, MDI As Long, welcome As Long
  2267.     Dim child As Long, UserString As String
  2268.     AOL& = FindWindow("AOL Frame25", vbNullString)
  2269.     MDI& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString)
  2270.     child& = FindWindowEx(MDI&, 0&, "AOL Child", vbNullString)
  2271.     UserString$ = GetCaption(child&)
  2272.     If InStr(UserString$, "Welcome, ") = 1 Then
  2273.         UserString$ = Mid$(UserString$, 10, (InStr(UserString$, "!") - 10))
  2274.         GetUser$ = UserString$
  2275.         Exit Function
  2276.     Else
  2277.         Do
  2278.             child& = FindWindowEx(MDI&, child&, "AOL Child", vbNullString)
  2279.             UserString$ = GetCaption(child&)
  2280.             If InStr(UserString$, "Welcome, ") = 1 Then
  2281.                 UserString$ = Mid$(UserString$, 10, (InStr(UserString$, "!") - 10))
  2282.                 GetUser$ = UserString$
  2283.                 Exit Function
  2284.             End If
  2285.         Loop Until child& = 0&
  2286.     End If
  2287.     GetUser$ = ""
  2288. End Function
  2289.  
  2290.  
  2291.  
  2292. Public Sub PlayMIDI(MIDIFile As String)
  2293.     Dim SafeFile As String
  2294.     SafeFile$ = Dir(MIDIFile$)
  2295.     If SafeFile$ <> "" Then
  2296.         Call mciSendString("play " & MIDIFile$, 0&, 0, 0)
  2297.     End If
  2298. End Sub
  2299.  
  2300. Public Sub StopMIDI(MIDIFile As String)
  2301.     Dim SafeFile As String
  2302.     SafeFile$ = Dir(MIDIFile$)
  2303.     If SafeFile$ <> "" Then
  2304.         Call mciSendString("stop " & MIDIFile$, 0&, 0, 0)
  2305.     End If
  2306. End Sub
  2307.  
  2308. Public Sub PlayWav(WavFile As String)
  2309.     Dim SafeFile As String
  2310.     SafeFile$ = Dir(WavFile$)
  2311.     If SafeFile$ <> "" Then
  2312.         Call sndPlaySound(WavFile$, SND_FLAG)
  2313.     End If
  2314. End Sub
  2315.  
  2316. Public Sub SetText(Window As Long, Text As String)
  2317.     Call SendMessageByString(Window&, WM_SETTEXT, 0&, Text$)
  2318. End Sub
  2319.  
  2320. Public Function ListToMailString(TheList As ListBox) As String
  2321.     Dim DoList As Long, MailString As String
  2322.     If TheList.List(0) = "" Then Exit Function
  2323.     For DoList& = 0 To TheList.ListCount - 1
  2324.         MailString$ = MailString$ & "(" & TheList.List(DoList&) & "), "
  2325.     Next DoList&
  2326.     MailString$ = Mid(MailString$, 1, Len(MailString$) - 2)
  2327.     ListToMailString$ = MailString$
  2328. End Function
  2329.  
  2330. Public Sub FormOnTop(FormName As Form)
  2331.     Call SetWindowPos(FormName.hWnd, HWND_TOPMOST, 0&, 0&, 0&, 0&, FLAGS)
  2332. End Sub
  2333.  
  2334. Public Sub FormNotOnTop(FormName As Form)
  2335.     Call SetWindowPos(FormName.hWnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, FLAGS)
  2336. End Sub
  2337.  
  2338. Public Sub FormDrag(TheForm As Form)
  2339.     Call ReleaseCapture
  2340.     Call SendMessage(TheForm.hWnd, WM_SYSCOMMAND, WM_MOVE, 0)
  2341. End Sub
  2342.  
  2343. Public Sub FormExitDown(TheForm As Form)
  2344.     Do
  2345.         DoEvents
  2346.         TheForm.Top = Trim(Str(Int(TheForm.Top) + 300))
  2347.     Loop Until TheForm.Top > 7200
  2348. End Sub
  2349.  
  2350. Public Sub FormExitLeft(TheForm As Form)
  2351.     Do
  2352.         DoEvents
  2353.         TheForm.Left = Trim(Str(Int(TheForm.Left) - 300))
  2354.     Loop Until TheForm.Left < -TheForm.width
  2355. End Sub
  2356.  
  2357. Public Sub FormExitRight(TheForm As Form)
  2358.     Do
  2359.         DoEvents
  2360.         TheForm.Left = Trim(Str(Int(TheForm.Left) + 300))
  2361.     Loop Until TheForm.Left > Screen.width
  2362. End Sub
  2363.  
  2364. Public Sub FormExitUp(TheForm As Form)
  2365.     Do
  2366.         DoEvents
  2367.         TheForm.Top = Trim(Str(Int(TheForm.Top) - 300))
  2368.     Loop Until TheForm.Top < -TheForm.width
  2369. End Sub
  2370.  
  2371. Public Sub WindowHide(hWnd As Long)
  2372.     Call ShowWindow(hWnd&, SW_HIDE)
  2373. End Sub
  2374.  
  2375. Public Sub WindowShow(hWnd As Long)
  2376.     Call ShowWindow(hWnd&, SW_SHOW)
  2377. End Sub
  2378.  
  2379. Public Sub RunMenu(TopMenu As Long, SubMenu As Long)
  2380.     Dim AOL As Long, aMenu As Long, sMenu As Long, mnID As Long
  2381.     Dim mVal As Long
  2382.     AOL& = FindWindow("AOL Frame25", vbNullString)
  2383.     aMenu& = GetMenu(AOL&)
  2384.     sMenu& = GetSubMenu(aMenu&, TopMenu&)
  2385.     mnID& = GetMenuItemID(sMenu&, SubMenu&)
  2386.     Call SendMessageLong(AOL&, WM_COMMAND, mnID&, 0&)
  2387. End Sub
  2388.  
  2389. Public Sub RunMenuByString(SearchString As String)
  2390.     Dim AOL As Long, aMenu As Long, mCount As Long
  2391.     Dim LookFor As Long, sMenu As Long, sCount As Long
  2392.     Dim LookSub As Long, sID As Long, sString As String
  2393.     AOL& = FindWindow("AOL Frame25", vbNullString)
  2394.     aMenu& = GetMenu(AOL&)
  2395.     mCount& = GetMenuItemCount(aMenu&)
  2396.     For LookFor& = 0& To mCount& - 1
  2397.         sMenu& = GetSubMenu(aMenu&, LookFor&)
  2398.         sCount& = GetMenuItemCount(sMenu&)
  2399.         For LookSub& = 0 To sCount& - 1
  2400.             sID& = GetMenuItemID(sMenu&, LookSub&)
  2401.             sString$ = String$(100, " ")
  2402.             Call GetMenuString(sMenu&, sID&, sString$, 100&, 1&)
  2403.             If InStr(LCase(sString$), LCase(SearchString$)) Then
  2404.                 Call SendMessageLong(AOL&, WM_COMMAND, sID&, 0&)
  2405.                 Exit Sub
  2406.             End If
  2407.         Next LookSub&
  2408.     Next LookFor&
  2409. End Sub
  2410.